Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 381491 - sys-boot/grub-1.99-r1 expects to find non-existant /dev/root
Summary: sys-boot/grub-1.99-r1 expects to find non-existant /dev/root
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tomáš Chvátal (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-01 20:51 UTC by Claes
Modified: 2011-09-07 14:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claes 2011-09-01 20:51:18 UTC
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.
Comment 1 Tomáš Chvátal (RETIRED) gentoo-dev 2011-09-03 20:17:43 UTC
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 :)
Comment 2 Claes 2011-09-03 22:40:48 UTC
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.
Comment 3 Tomáš Chvátal (RETIRED) gentoo-dev 2011-09-04 08:39:07 UTC
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.
Comment 4 Tomáš Chvátal (RETIRED) gentoo-dev 2011-09-04 09:49:06 UTC
Fixed in 1.99-r2. :)
Comment 5 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2011-09-05 20:29:53 UTC
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?
Comment 6 Claes 2011-09-07 14:37:37 UTC
I opened an issue about that new problem here:
https://bugs.gentoo.org/show_bug.cgi?id=381761