From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1civ6c-0006Zv-P8 for mharc-grub-devel@gnu.org; Tue, 28 Feb 2017 22:39:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1civ6a-0006ZK-5e for grub-devel@gnu.org; Tue, 28 Feb 2017 22:39:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1civ6X-000632-15 for grub-devel@gnu.org; Tue, 28 Feb 2017 22:39:08 -0500 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:33936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1civ6W-00062M-Q0 for grub-devel@gnu.org; Tue, 28 Feb 2017 22:39:04 -0500 Received: by mail-lf0-x234.google.com with SMTP id k202so13801614lfe.1 for ; Tue, 28 Feb 2017 19:39:04 -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=J72XSRz7Rk5z2xj7lWArCAG3Y7OCeDiUjmsM29ntcac=; b=a4KdmF8craz/j0gqeBXmBFjOopBeHsRJZte7IL4D7DMooHTaGq6sbHBive/cEqrxFE ROzY/N5Lk2kgLv+nnki6adUSpVALQtBZ+E52txD/Z2ZokMx7BRvvE4Paa7UkRJfsXiL0 /hx1uwMDCiTAt4QMdTipETFiHGcDrja51x7F3n7xS3jcfV/n+1QboeAcm8zQr4cOk7gh CmWhgv/7OzQ93ZPUFaDtC2I5ob3l+kNIpqxc0gVd/CYA4c6rgLF3KO/GphN0SvDfjEnt jVPSSQDWT3P39sG4QF5ELVIU6Fbxw0ZYZ+hq8qzNz5kzCZf6ZJ1liWG7z17njzqjG46X r/Gw== 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=J72XSRz7Rk5z2xj7lWArCAG3Y7OCeDiUjmsM29ntcac=; b=matoFzibr6oE9pnDRsID8+qxkNETwE4g4Ot3LGQfSLUZSLFQsQ/JnX+W725Cjsrz0Y /wRdZivBU3cMbU4KXhhEJy+NK9JUkAJHvRqaiPIovhuUSTR6K4PCrMfYJKs2ALTS+6u5 WqjAT4FSzMsZ8VTxEUn3NqM7w4IS1Kq9exzRQYT0aifDB8rqA/lprEWGhXxxvl00SPqV INfDrPAZ4v/rpBMQgZ5vLWs83O+n5h8s67ev+i+5JCc55yf5h7ZfX4AOJh0Be/iBr8EX VRNtdKAYDymAzGXjsawmvEYna3AAWNaDZ9EhYk2G7RZcsY082tPgD7I1g4tXhr0mhQjR WHGg== X-Gm-Message-State: AMke39lHHLuuCC+DIUh0TofOYZfG5ddPRPdl2zu2hBvLr/5pCBmsdDz6dkjNmvB0q8rAcg== X-Received: by 10.25.233.201 with SMTP id j70mr1888799lfk.20.1488339543090; Tue, 28 Feb 2017 19:39:03 -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 12sm785221lju.16.2017.02.28.19.39.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 19:39:02 -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> <15e78e1d-9d62-5598-dcf9-dca40f85c633@gmail.com> <20170228220534.GB31496@csclub.uwaterloo.ca> From: Andrei Borzenkov Message-ID: <5b921acd-bbce-a65c-04fc-93476b4bff80@gmail.com> Date: Wed, 1 Mar 2017 06:39:01 +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: <20170228220534.GB31496@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::234 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: Wed, 01 Mar 2017 03:39:09 -0000 01.03.2017 01:05, Lennart Sorensen пишет: > On Tue, Feb 28, 2017 at 09:50:27PM +0300, Andrei Borzenkov wrote: >> 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. > > Oh now I see what you mean. Hmm, that is an interesting problem. > > It seems FFS and UFS reserve either 1 or 8KB at the start for bootblock, > which I suppose would save the disklabel from being overwritten if using > one of those filesystems. Solaris usually does not have issues with slice containing label as the first block. Native tools (UFS, ZFS, SVM) and non-native (Veritas) all preserve it. So I never considered it something unusual.