From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Yttin-0006nV-2M for mharc-grub-devel@gnu.org; Sun, 17 May 2015 04:14:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yttik-0006my-8X for grub-devel@gnu.org; Sun, 17 May 2015 04:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yttif-0001m7-GT for grub-devel@gnu.org; Sun, 17 May 2015 04:14:50 -0400 Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:32800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yttif-0001le-4Q for grub-devel@gnu.org; Sun, 17 May 2015 04:14:45 -0400 Received: by lagr1 with SMTP id r1so97090695lag.0 for ; Sun, 17 May 2015 01:14:44 -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=k+35KWo2hN4EM/ZYErXix3tot6TCzH6FQo3DdaFjvw4=; b=AXlPQ2CDKbnS3AjZLYJ31G74cPkoN6/nplGLV/GrzOPVPMQIl65Mv8tA0+WpnQj2PG sJvq7xliFkQHjVUSAu4NKgZrJfMLNolPpSDrL5vzvzqp5c02SrWOO4W4fVmT+gs7+uBE lVTbr71hDMz1REX4mArEPvuKKoHuvRILmXzqPCf2VtWHNAkDapYzh4E6QTncBf2N12GR 3bewpXgXkpOeTbucmKglze73ld/Aw6vKYhprBSHfVblAI++SoRgxGTOkHHpNeR80u8uX uyE5TyY+DZgWqkI2leZiCn1Jf3Mft9cd5+gNPw7pAyMw19dWwF5WovlekWwZOeOzDvmy I5uA== X-Received: by 10.152.116.49 with SMTP id jt17mr3691202lab.82.1431850484099; Sun, 17 May 2015 01:14:44 -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 m8sm1726119lbs.17.2015.05.17.01.14.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 01:14:42 -0700 (PDT) Date: Sun, 17 May 2015 11:14:40 +0300 From: Andrei Borzenkov To: Sebastian Pipping Subject: Re: Future of installing GRUB to LVM volumes (and loop devices) Message-ID: <20150517111440.3d550ffd@opensuse.site> In-Reply-To: <5555CD85.4050804@pipping.org> References: <5548F5AB.4080305@pipping.org> <20150505203836.30e66cbc@opensuse.site> <554A0948.9050301@pipping.org> <20150506201645.492f1743@opensuse.site> <5551D8CF.8080905@pipping.org> <20150512144143.6f4713d0@opensuse.site> <5555BC53.9030308@pipping.org> <5555CD85.4050804@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::231 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: Sun, 17 May 2015 08:14:52 -0000 =D0=92 Fri, 15 May 2015 12:42:13 +0200 Sebastian Pipping =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Hello Andrei, >=20 >=20 > On 05/15/2015 11:34 AM, Andrei Borzenkov wrote: > > On Fri, May 15, 2015 at 12:28 PM, Sebastian Pipping > > wrote: > >> > >> I understand that some relations may be hard to impossible to detect. > >> The cases that I have are plain parent-child relations, though. > >> It would rock the house to get these cases covered again. > >> > >> (On a side note, text "unknown device type loop0" looks like a bug to = me > >> since "loop0" is not a type.) > >=20 > > It comes from Open Firmware part. May be it should be downgraded to > > Info. But as long as it happens in grub-probe only it is OK. >=20 > my point was more about the text of the error message. >=20 >=20 > >>>>> Half working solution would be to assume that it is always child ma= p. > >>>>> > >>>>> 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. > >>>>> > >>>>> Patches are welcome. > >>>> > >>>> I am still wondering: how come it was working in GRUB 2.00 but now > >>>> longer is? > >>>> > >>> > >>> But by you said in previous message that HEAD works? Not sure how > >>> though :) > >> > >> That referred to the '(hd0)'-parameter-with-device-map case, only. > >> > >> This patch to grml-debootstrap says best what has stopped working: > >> https://github.com/hartwork/grml-debootstrap/commit/a705ff45c2d053b0d9= 0ec51700e2d25a760106f3 > >> > >=20 > > Could you please describe your exact configuration that does not work > > (including all devices and their relationships) and what does not > > work? Sorry if you did it already but I somehow lost track here. >=20 > Sure. >=20 > The setup is a single plain partition in an LVM volume. >=20 > The following commands reproduce the setup (in RAM if /tmp is tmpfs). > With a plain LVM volume, the error is the same tough. >=20 > # tmpfile=3D"$(mktemp)" > # echo "${tmpfile}" > # truncate --size=3D$((100*1024**2)) "${tmpfile}" > # loop_device_2=3D"$(losetup --show -f "${tmpfile}")" > # echo "${loop_device_2}" > # vgcreate vg "${loop_device_2}" > # lvcreate --name lv -l 100%free vg > # sleep 1 >=20 > # parted /dev/vg/lv --script mklabel msdos > # parted /dev/vg/lv --script mkpart primary ext4 4m 100% > # sleep 1 > # mkfs.ext4 /dev/mapper/vg-lv1 > # mkdir /mnt/lv-root > # mount /dev/mapper/vg-lv1 /mnt/lv-root > # mkdir /mnt/lv-root/boot > # grub-install --boot-directory=3D/mnt/lv-root/boot /dev/mapper/vg-lv ; > echo $? > Installing for i386-pc platform. > grub-install: error: disk > `lvmid/KO9MVd-KNgN-Nbo0-RJb0-pGdK-K7lO-apdskW/rrvxSA-SFY6-P6gy-1jYv-0ims-= RmyL-m1KZMB' > not found. > 1 >=20 Yes, it got broken during code rearrange. grub effectively ignores device.map at this point: opensuse:/home/bor/build/grub # ./grub-probe --verbose -t drive -m /tmp/dev= ice.map -d /dev/mapper/vg-lv ./grub-probe: info: adding `hd0' -> `/dev/dm-5' from device.map. ./grub-probe: info: /dev/mapper/vg-lv is present in device map. ./grub-probe: info: Looking for /dev/mapper/vg-lv. ./grub-probe: info: /dev/mapper/vg-lv (0) is a parent of /dev/mapper/vg-lv. ./grub-probe: info: /dev/mapper/vg-lv is present in device map. ./grub-probe: info: Looking for /dev/mapper/vg-lv. ./grub-probe: info: /dev/mapper/vg-lv (0) is a parent of /dev/mapper/vg-lv. (lvmid/Q7vbHZ-MAzV-RtmN-lWJh-I2z3-2Jz2-CJRBgf/NyMQtV-4NgS-uXZ0-3klS-VQ7c-zM= Vz-butVbK) Comparing 2.00 and current head: 2.00: char * grub_util_get_grub_dev (const char *os_dev) { char *grub_dev =3D NULL; grub_util_pull_device (os_dev); switch (grub_util_get_dev_abstraction (os_dev)) { #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel_= _) case GRUB_DEV_ABSTRACTION_LVM: { and current head: char * grub_util_get_grub_dev (const char *os_dev) { char *ret; grub_util_pull_device (os_dev); ret =3D grub_util_get_devmapper_grub_dev (os_dev); So device.map effectively got ignored at this point. I'm not sure whether it was intentional; Vladimir? Hmm ... grub_util_get_devmapper_grub_dev() actually always returns either LVM or LUKS device. At which point we probably have to check whether device abstraction is really one of them. Anyway, Sebastian, thanks for report; could you open bug report so it is not lost?