From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Ys8ZQ-0002Ea-VI for mharc-grub-devel@gnu.org; Tue, 12 May 2015 07:41:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys8ZN-0002CW-Jl for grub-devel@gnu.org; Tue, 12 May 2015 07:41:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys8ZI-0003ez-6T for grub-devel@gnu.org; Tue, 12 May 2015 07:41:53 -0400 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:35444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys8ZH-0003ep-Ut for grub-devel@gnu.org; Tue, 12 May 2015 07:41:48 -0400 Received: by labbd9 with SMTP id bd9so3476732lab.2 for ; Tue, 12 May 2015 04:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=f7DAA9k1dmT+muftqAYn2DUL6OUuyG8r46Y4ldegI0E=; b=X0Ntz90mfNUl/1touMFPtDeWnzj6nPWNo6zCzaffkxmK4LHxPrv+x2zcbYwEKzD/fO RjWLBZ+o0mn3gQeQpAJV37EgUaG1eLIF6brD21zzWzDKeotpSo97Kgf5iLNN8D8/VTQs aa+UKiy/kuLGUzCHk1qJI+2fRGRmrMNgY3D0nwz+ZUyKAAi2vdvyfVBijM3635ZTFnTm xwH5K16L8yLAX0/wF0sD81a2XH8fhGTXpe8a2BqMgLHkJkx1DkJTY6sR9HwXZKBB6TmN M9az9aMYvbf0wGrGPTTUQduR0SY9XvS4B9Kbd3cs/HB2p3vOTwibYC/XHl5CkuKTIDLq BUhQ== X-Received: by 10.112.205.231 with SMTP id lj7mr11839785lbc.42.1431430906787; Tue, 12 May 2015 04:41:46 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id du2sm3754930lbc.44.2015.05.12.04.41.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 04:41:45 -0700 (PDT) Date: Tue, 12 May 2015 14:41:43 +0300 From: Andrei Borzenkov To: Sebastian Pipping Subject: Re: Future of installing GRUB to LVM volumes (and loop devices) Message-ID: <20150512144143.6f4713d0@opensuse.site> In-Reply-To: <5551D8CF.8080905@pipping.org> References: <5548F5AB.4080305@pipping.org> <20150505203836.30e66cbc@opensuse.site> <554A0948.9050301@pipping.org> <20150506201645.492f1743@opensuse.site> <5551D8CF.8080905@pipping.org> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.27; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2015 11:41:54 -0000 =D0=92 Tue, 12 May 2015 12:41:19 +0200 Sebastian Pipping =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > >> Auto-detection of a filesystem of /dev/mapper/loop0p1 failed. > >> Try with --recheck. > >> If the problem persists please report this together with the output of > >> "/usr/sbin/grub-probe --device-map=3D"/mnt/loop-root/boot/grub/device.= map" > >> --target=3Dfs -v /mnt/loop-root/boot/grub" to > >> 1 > >> # mount | fgrep /mnt/loop-root > >> /dev/mapper/loop0p1 on /mnt/loop-root type ext4 > >=20 > > There is no feasible way to map this device back to contained device, > > short of scanning all maps, finding all partition labels on them and > > matching maps against labels. >=20 > Why not? >=20 > lsblk manages to detect that /dev/mapper/loop0p1 is a child of /dev/loop0: >=20 > # lsblk | fgrep loop | sed 's| \{23\}||' > loop0 7:0 0 100M 0 loop > =E2=94=94=E2=94=80loop0p1 (dm-9) 254:9 0 96M 0 part /mnt/loop-= root > That's what mean - this is direct parent-child. But consider bor@opensuse:~/build/grub> echo 0 2048 linear /dev/loop0 0 | sudo dmsetup c= reate whole bor@opensuse:~/build/grub> echo 0 59392 linear /dev/loop0 2048 | sudo dmset= up create part At this point /dev/mapper/part refers to partition of /dev/mapper/whole but there is not direct relationships between two that you can easily discover bor@opensuse:~/build/grub> sudo dmsetup ls --tree whole (254:5) =E2=94=94=E2=94=80 (7:0) part (254:6) =E2=94=94=E2=94=80 (7:0) and bor@opensuse:~/build/grub> sudo ./grub-probe -t hints_string -m device.map= /mnt=20 ./grub-probe: warning: unknown device type loop0 . bor@opensuse:~/build/grub> cat device.map=20 (hd0) /dev/mapper/whole but bor@opensuse:~/build/grub> sudo ./grub-probe -t hints_string -m device.map= /mnt=20 ./grub-probe: warning: unknown device type loop0 . --hint=3D'hd0,msdos1'=20 bor@opensuse:~/build/grub> cat device.map (hd0) /dev/loop0 So in common cases it will work and is better as nothing, but there will be= corner cases that may fail. >=20 > > Half working solution would be to assume that it is always child map. > >=20 > > Or you can take shortcut and assume that /dev/mapper/XXXXpY is > > partition of /dev/mapper/XXX but you still will need to verify it. > >=20 > > Patches are welcome. >=20 > I am still wondering: how come it was working in GRUB 2.00 but now > longer is? >=20 But by you said in previous message that HEAD works? Not sure how though :)