After replacing grub with grub2, I hit an issue with grub failing to properly find my partitions. Line 144 from grub2-mkconfig: GRUB_DEVICE="`${grub_probe} --target=device /`" interpreted as: /sbin/grub2-probe --target=device / fails with: /sbin/grub2-probe: error: cannot stat `/dev/root'. This isn't strange as /dev/root just does not exist. At first I thought this was because I use systemd, but starting with OpenRC yields the same result. Then I just changed line 144, hardcoding my partition: GRUB_DEVICE="/dev/sda3" I then hit the same error on line 148, so I hardcode my boot parition as well: GRUB_DEVICE_BOOT="/dev/sda1" with this, a cfg is properly generated, and I can boot form it as expected.
I wonder how to reproduce this but I think /dev/root should be created by udev? scarabeus@arcarius: ~ $ stat /dev/root Soubor: „/dev/root“ -> „dm-0“ Velikost: 4 Bloků: 0 I/O blok: 4096 symbolický odkaz Zařízení: eh/14d I-uzel: 9711 Odkazů: 1 Práva: (0777/lrwxrwxrwx) UID: ( 0/ root) GID: ( 0/ root) Přístup: 2011-09-03 22:15:40.642580834 +0200 Změna obsahu: 2011-09-01 22:40:52.240043105 +0200 Změna i-uzlu: 2011-09-01 22:40:52.240043105 +0200 Vznik: - Or other way around it was removed from udev to reduce the issues, I don't remember... Anyway I will try to think up some patch :)
So with the added understanding that udev should create the missing file, I googled a bit for grub and udev. I found this: http://www.mail-archive.com/grub-devel@gnu.org/msg17455.html which indicates that the culprit is the combination of udev-171 and grub-1.99. However, it also appears that the problem has been solved, so perhaps this issue can just be put on hold, pending a new upstream release.
Yeah I managed to reproduce it and it is really fixed in grub-9999. The issue is that such problems should not happen a lot with package that is supposed to boot your system :) I will try to look up the code that made this work and backport it.
Fixed in 1.99-r2. :)
This fixed the /dev/root problem for me, but now it fails with this: raven ~ # grub2-mkconfig /sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?). Here is the mount output: raven ~ # mount rootfs on / type rootfs (rw) /dev/root on / type btrfs (rw,noatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) rc-svcdir on /lib/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620) shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime) nfsd on /proc/fs/nfsd type nfsd (rw,noexec,nosuid,nodev) Might be related to the btrfs filesystem. Any ideas?
I opened an issue about that new problem here: https://bugs.gentoo.org/show_bug.cgi?id=381761