From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cimr5-0004Ew-S4 for mharc-grub-devel@gnu.org; Tue, 28 Feb 2017 13:50:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cimr3-0004Db-RR for grub-devel@gnu.org; Tue, 28 Feb 2017 13:50:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cimr0-0007Xz-Q9 for grub-devel@gnu.org; Tue, 28 Feb 2017 13:50:33 -0500 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:35399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cimr0-0007XN-Iv for grub-devel@gnu.org; Tue, 28 Feb 2017 13:50:30 -0500 Received: by mail-lf0-x231.google.com with SMTP id z127so9574526lfa.2 for ; Tue, 28 Feb 2017 10:50:30 -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=IZDAdtHuVQrWbRwlER+3cngmP2cr41K1hBlIf0pnZgk=; b=PBVeU7uXShNbO+Nlkx60SNbQysloupHPM/QI9OP5buxvZ3QC8yPrav4AnjqtYYKOwC fZ+dW/tzs7vQ67N06uVJZ3+7T4WxPFF6l5l5DdVbMKV/2VIvJjCAAntv3ESu47mvssUF cCOTLnFvXl8mXGb8KFsP6HsLhmd8WQMxysfU2InFWwja12qzTnOWCLv5ElrT+H10UwCo XalMBnwmU2JZOalOr9zVckwCJirEM0uhn9UorZcGkp2ED6PhiKAKJfAY673mKn7Utn4p oEKaDeMtPOKNXmWacpqtHJuMkn54tePRd0uc0x9XuTUfQE2fB2N4k9RAs/45dPnocCgF 3g8w== 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=IZDAdtHuVQrWbRwlER+3cngmP2cr41K1hBlIf0pnZgk=; b=doNaL/t3ZyOyp082DVR/IlaAC/C3c83XjXWSq4ppO82fKUlSE8no4HOKBBhQ7/cAne XyQqM0OIKwLwnbXYiBeshdbnF4dudim0gab4gYFksjTnL/5ONWvtevCw4Ss2KWKLebpr +L30SEQOkekGt8Tf42SHRX/joSlIEBEH2CuVwh2LT+dvGGQOFWCOzoh+yoma2wA7GKG+ ADp/kKCMN6gIyLP8+3jf1uJLZQe4Z39eBECtNhq8jzVwzEiuneLM0SRJ+DftYuCywtrI Z09+d2MkUmRGpco4ZFhCk6OvMCekx8sXSWyy5piMutZhFPMJ0/sjdJ8q/Rsniq/Po5cL RDNA== X-Gm-Message-State: AMke39l22PqTlvJIuakd3x/8/JIt9DzeRJVKuyNZ8qrCIIPRy4xh2w7kSyr3vrUZ+qzn0A== X-Received: by 10.25.212.4 with SMTP id l4mr1223462lfg.48.1488307828725; Tue, 28 Feb 2017 10:50:28 -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 y6sm548636ljd.55.2017.02.28.10.50.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 10:50:28 -0800 (PST) Subject: Re: grub-probe for nested BSD partition on Linux To: grub-devel@gnu.org References: <2e48f17a-20d7-c9cb-2300-1bc5fec88f12@gmail.com> <20170228183141.GA31496@csclub.uwaterloo.ca> From: Andrei Borzenkov Message-ID: <15e78e1d-9d62-5598-dcf9-dca40f85c633@gmail.com> Date: Tue, 28 Feb 2017 21:50:27 +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: <20170228183141.GA31496@csclub.uwaterloo.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::231 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 18:50:34 -0000 28.02.2017 21:31, Lennart Sorensen пишет: > On Tue, Feb 28, 2017 at 08:13:53PM +0300, Andrei Borzenkov wrote: >> 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. > > Well that does look mostly sane for an ancient BSD version. > In case I was not clear. BSD partition a is represented in Linux as /dev/vda7. grub-probe -t compatibility_hints -d /dev/vda7 returns hd0,msdos2 which is obviously wrong, because it refers to 2GB area on disk while partition /dev/vda7 is just 256M. I would expect either hd0,msdos2,openbsd1 or nothing depending on whether such nested partition is supported. > Slice a is the rootfs for BSD > > Slice b should traditionally be swap, but appears to be unused here, > and for some reason uses the same part of the disk as slice a, which > does look odd. Maybe since the type is unknown, it doesn't matter. > > Slice c is the whole partition containing the slices (vda2) > > Slice d is the whole disk (vda), which apparently hasn't been used in > BSD for a couple of decades now, if wikipedia can be trusted. > > So if linux only bothers to count the partition with a type that isn't > unused, then it probably makes sense. That appears to be what the > partition parsing code does. > > The start being the same as the start of vda2 does seem odd given it > appears that you are supposed to leave space at the start (1 track > recommended, or 64 sectors), and it appears the disklabel is at sector > 1 (0 being the first), so it doesn't seem like having your filesystem > start there would be safe unless the filesystem has reserved space at > the start for such things. > I just pressed 'b' in Linux fdisk and only change two partition sizes. I have no idea how fdisk choses partition start. Could be a bug in fdisk.