Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cilLg-00016Z-6D for mharc-grub-devel@gnu.org; Tue, 28 Feb 2017 12:14:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cilLd-00016J-DV for grub-devel@gnu.org; Tue, 28 Feb 2017 12:14:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cilLa-0002A6-7q for grub-devel@gnu.org; Tue, 28 Feb 2017 12:14:01 -0500 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:35931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cilLZ-00029w-W3 for grub-devel@gnu.org; Tue, 28 Feb 2017 12:13:58 -0500 Received: by mail-lf0-x22d.google.com with SMTP id y193so8468958lfd.3 for ; Tue, 28 Feb 2017 09:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=6MbbxZmtQtNejP5wA1vWNBrBhmL4OeqE15XgvQ7afRc=; b=TjMverPMvvb2cZUmDMzG7RxyZADSeGwMB5xn+QwkG+g0zur25tzKmuWR7QkxixrbRN KQl1HNJ63DD14AItN2/13QyOFneN1DNiTlIbfOl30pF5Ip3wpmyza4fVtzQ0wmepxZtV Nwh9QcmKR4RLM9UKypzqDUaTVHKCLWyU8kIrV8sJ5Cwq7h/9auat6T28jbO/TXM0Lcyc S2FCNqzVPN1ls4aavqebYmrmT8hkl3qj9QEUFv/DZjk4bTAgwMBq7Iqjsb6Ga0l3plnB zQTBvKVY2x7pwiFn5/CJI7Gv+ZFCtxZxxJiuhQ3FnaR3GnwkzfjG0Hhr1jx6sJ4YUSUd eB1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6MbbxZmtQtNejP5wA1vWNBrBhmL4OeqE15XgvQ7afRc=; b=A20cmLW7qQVclFIqNjAKGqDznfJGaSbwd+kz7kvidDTqTe3NuHS3PjxPGvNXo11fDC x592yNXO7WENSM12o92ydWZcQumScykijK4NTgWGSz9NQn2mv4U6xSOtF8ZfXSkEk3FE U1JykRv9LvYwFVnHW3QdsnxYZEY0F9bAfeIwqNLW4MnP7PYU7xUryLdAExaUHvAYlhQ1 r1I8AacoSPSZuUE9jYeGiFEZwU4xm9PIOKfZTH04xFAe5MsIpz4ITP1dD90sAAkHt0Wk MKwgkcKXUumPSy2ggWlZYfYJ1nNes/V8h1R44f1ZsOb+/WfVetwbtnCsaFa3OigADDSB zgJQ== X-Gm-Message-State: AMke39n45VolMArJdZYk/ONfMjT20J5P4kP8/6JmzAbQQfTu57InAkV7Kx5HZ08rCRBoVA== X-Received: by 10.25.195.11 with SMTP id t11mr1139326lff.165.1488302035027; Tue, 28 Feb 2017 09:13:55 -0800 (PST) Received: from [192.168.1.6] (ppp109-252-90-129.pppoe.spdop.ru. [109.252.90.129]) by smtp.gmail.com with ESMTPSA id u30sm520856ljd.4.2017.02.28.09.13.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 09:13:54 -0800 (PST) Subject: grub-probe for nested BSD partition on Linux (was: [PATCH 1/1] add --partuuid to probe) To: grub-devel@gnu.org References: <20170214180035.3461-1-skenton@ou.edu> <2e48f17a-20d7-c9cb-2300-1bc5fec88f12@gmail.com> From: Andrei Borzenkov Message-ID: Date: Tue, 28 Feb 2017 20:13:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22d X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 17:14:02 -0000 28.02.2017 17:08, Vladimir 'phcoder' Serbinenko пишет: >> >> OK I see, kernel skips BSD partition marked as "unused". >> >> So it appears that kernel always puts special nested partitions after >> normal logical MSDOS partitions, so it will not skew MSDOS partition >> numbers. >> >> [ 1.529752] vda: vda1 vda2 vda3 < vda5 vda6 > >> vda2: >> >> >> /* >> * Look for partitions in two passes: >> * First find the primary and DOS-type extended partitions. >> * On the second pass look inside *BSD, Unixware and Solaris >> partitions. >> */ >> >> For such partition (vda7) PARTUUID is empty. >> >> P.S. I wonder whether we correctly map such partition ... no, we do not. >> >> 10:~ # cat /tmp/foo >> (hd0) /dev/vda >> 10:~ # grub2-probe -m /tmp/foo -t compatibility_hint -d /dev/vda2 >> hd0,msdos2 >> 10:~ # grub2-probe -m /tmp/foo -t compatibility_hint -d /dev/vda5 >> hd0,msdos5 >> 10:~ # grub2-probe -m /tmp/foo -t compatibility_hint -d /dev/vda7 >> hd0,msdos2 >> > WAI. In case when subpartition starts at the same sector as partition > itself. > Sorry? vda7 is 256M, how can you suddenly pretend it is 2G? 10:~ # fdisk -l /dev/vda Disk /dev/vda: 5 GiB, 5368709120 bytes, 10485760 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x882b18da Device Boot Start End Sectors Size Id Type /dev/vda1 2048 2099199 2097152 1G 83 Linux /dev/vda2 2099200 6293503 4194304 2G a6 OpenBSD /dev/vda3 6293504 10485759 4192256 2G 5 Extended /dev/vda5 6295552 6819839 524288 256M 83 Linux /dev/vda6 6821888 7346175 524288 256M 83 Linux 10:~ # fdisk -l /dev/vda2 Disk /dev/vda2: 2 GiB, 2147483648 bytes, 4194304 sectors Geometry: 16 heads, 63 sectors/track, 10402 cylinders Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: bsd Slice Start End Sectors Size Type Fsize Bsize Cpg a 2099200 2623488 524289 256M boot 0 0 0 b 2099200 2623488 524289 256M unused 0 0 0 c 2099200 6293503 4194304 2G unused 0 0 0 d 0 10485215 10485216 5G unused 0 0 0 Partition table entries are not in disk order.