Bug#549165: grub-legacy: It seems this bug is back

Lionel Elie Mamane lionel at mamane.lu
Wed Aug 4 15:32:59 UTC 2010


christian mock <cm at tahina.priv.at> wrote:

> I'm seeing what seems to be the very same problem reported in this
> bug, just with newer versions of grub-legacy and dmsetup:

> # sh -x /usr/sbin/update-grub
> [...]
> ++ grub-probe --device-map=/boot/grub/device.map -t device /
> + root_device=

> # grub-probe --device-map=/boot/grub/device.map -t device /
> grub-probe: error: cannot find a device for / (is /dev mounted?).

> # mount
> /dev/dm-0 on / type ext3 (rw,errors=remount-ro)
> [...]

> # ls -l /dev/dm-0 /dev/mapper/rootvg-root
> brw-rw---- 1 root disk 253, 0 Jun 24 22:06 /dev/dm-0
> lrwxrwxrwx 1 root root      7 Jun 24 22:06 /dev/mapper/rootvg-root -> ../dm-0

I have this too. From reading grub2 bug #550704, its seems this comes
from /dev/mapper/* now being symlinks instead of files, and in grub2,
grub-probe was fixed to handle that situation.

This temporarily resolved the situation (until next reboot, naturally):

root at doggy:~# cd /dev/mapper/
root at doggy:/dev/mapper# ls
control  doggy-root  doggy-swap_1
root at doggy:/dev/mapper# ls -l
total 0
crw------- 1 root root 10, 59 aoû  4 14:24 control
lrwxrwxrwx 1 root root      7 aoû  4 17:23 doggy-root -> ../dm-1
lrwxrwxrwx 1 root root      7 aoû  4 17:18 doggy-swap_1 -> ../dm-0
root at doggy:/dev/mapper# mv doggy-root doggy-root-bak
root at doggy:/dev/mapper# cp -ad ../dm-1 doggy-root
root at doggy:/dev/mapper# ls -l
total 0
crw------- 1 root root  10, 59 aoû  4 14:24 control
brw-rw---- 1 root disk 254,  1 aoû  4 17:23 doggy-root
lrwxrwxrwx 1 root root       7 aoû  4 17:23 doggy-root-bak -> ../dm-1
lrwxrwxrwx 1 root root       7 aoû  4 17:18 doggy-swap_1 -> ../dm-0
root at doggy:/dev/mapper# update-grub 
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found:
/boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-2.6.32-5-amd64
Found kernel: /vmlinuz-2.6.32-3-amd64
Updating /boot/grub/menu.lst ... done


(Replace "doggy-root" and "dm-1" by the right values for your disk
layout.)


I suggest that the grub-probe fix from grub2 be back-ported to grub.

-- 
Lionel





More information about the Pkg-grub-devel mailing list