[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Future of installing GRUB to LVM volumes (and loop devices)
From: |
Andrei Borzenkov |
Subject: |
Re: Future of installing GRUB to LVM volumes (and loop devices) |
Date: |
Tue, 12 May 2015 14:41:43 +0300 |
В Tue, 12 May 2015 12:41:19 +0200
Sebastian Pipping <address@hidden> пишет:
>
> >> 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="/mnt/loop-root/boot/grub/device.map"
> >> --target=fs -v /mnt/loop-root/boot/grub" to <address@hidden>
> >> 1
> >> # mount | fgrep /mnt/loop-root
> >> /dev/mapper/loop0p1 on /mnt/loop-root type ext4
> >
> > 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.
>
> Why not?
>
> lsblk manages to detect that /dev/mapper/loop0p1 is a child of /dev/loop0:
>
> # lsblk | fgrep loop | sed 's| \{23\}||'
> loop0 7:0 0 100M 0 loop
> └─loop0p1 (dm-9) 254:9 0 96M 0 part /mnt/loop-root
>
That's what mean - this is direct parent-child. But consider
address@hidden:~/build/grub> echo 0 2048 linear /dev/loop0 0 | sudo dmsetup
create whole
address@hidden:~/build/grub> echo 0 59392 linear /dev/loop0 2048 | sudo dmsetup
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
address@hidden:~/build/grub> sudo dmsetup ls --tree
whole (254:5)
└─ (7:0)
part (254:6)
└─ (7:0)
and
address@hidden:~/build/grub> sudo ./grub-probe -t hints_string -m device.map
/mnt
./grub-probe: warning: unknown device type loop0
.
address@hidden:~/build/grub> cat device.map
(hd0) /dev/mapper/whole
but
address@hidden:~/build/grub> sudo ./grub-probe -t hints_string -m device.map
/mnt
./grub-probe: warning: unknown device type loop0
.
--hint='hd0,msdos1'
address@hidden:~/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.
>
> > Half working solution would be to assume that it is always child map.
> >
> > 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 :)
- Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/05
- Re: Future of installing GRUB to LVM volumes (and loop devices), Andrei Borzenkov, 2015/05/05
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/06
- Re: Future of installing GRUB to LVM volumes (and loop devices), Andrei Borzenkov, 2015/05/06
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/12
- Re: Future of installing GRUB to LVM volumes (and loop devices),
Andrei Borzenkov <=
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/15
- Re: Future of installing GRUB to LVM volumes (and loop devices), Andrei Borzenkov, 2015/05/15
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/15
- Re: Future of installing GRUB to LVM volumes (and loop devices), Jordan Uggla, 2015/05/15
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/16
- Re: Future of installing GRUB to LVM volumes (and loop devices), Jordan Uggla, 2015/05/16
- Re: Future of installing GRUB to LVM volumes (and loop devices), Andrei Borzenkov, 2015/05/17
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/21
- Re: Future of installing GRUB to LVM volumes (and loop devices), Vladimir 'phcoder' Serbinenko, 2015/05/21
- Re: Future of installing GRUB to LVM volumes (and loop devices), Sebastian Pipping, 2015/05/21