Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub-probe / grub-mkconfig doesn't find my root device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Palatis
n00b
n00b


Joined: 07 Oct 2006
Posts: 23
Location: Taipei/Taiwan

PostPosted: Sun Jan 30, 2011 12:15 pm    Post subject: grub-probe / grub-mkconfig doesn't find my root device Reply with quote

Recently I'm trying grub-2 (grub-9999), and trying to let `grub-mkconfig` create grub.cfg for me.

This is my disk setup:
    /dev/sda1: swap 4gb (for swsusp, must be greater than ram size for it to work...)
    /dev/sda2: /boot 100mb
    /dev/sda3: / 1GB
    /dev/sda4: /home (rest of the disk)


`grub-install /dev/sda` works flawlessly, copies all files into '/boot/grub', but grub-mkconfig fails with

Code:
# grub-mkconfig -o /boot/grub/grub.cfg
/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).


I have my system mount as:
Code:
# mount
rootfs on / type rootfs (rw)
/dev/root on / type btrfs (rw,noatime,nodiratime,compress)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,noatime,nodiratime)
/dev/sda4 on /home type ext4 (rw,nodev,noatime,nodiratime,barrier=1,data=ordered)
none on /tmp type tmpfs (rw,nodev,noatime,nodiratime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfs-fuse-daemon on /home/palatis/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
/dev/sda2 on /boot type ext2 (rw,nodev,noatime,nodiratime,errors=continue)


It looks like that / is mounted from /dev/root (instead of /dev/sda3).

I tried to do `ln -s /dev/sda3 /dev/root`, and then grub-mkconfig works without error, but the grub.cfg it generates `root=/dev/root` instead of `root=/dev/sda3` in grub.cfg:
Code:
linux   /vmlinuz-2.6.37-gentoo root=/dev/root ro splash=silent,theme:livecd-2007.0 quiet console=tty1 resume=swap:/dev/sda1 fastboot

which cause the boot to fail.

I have
Code:
/dev/sda3   /      btrfs   noatime,nodiratime,compress      0 1

in my /etc/fstab.

I think it's responsible for openrc to mount rootfs, but why is / mounted from /dev/root instead of /dev/sda3? What should I do to let `grub-probe` find the correct root for me?
Back to top
View user's profile Send private message
Palatis
n00b
n00b


Joined: 07 Oct 2006
Posts: 23
Location: Taipei/Taiwan

PostPosted: Fri Feb 18, 2011 2:41 am    Post subject: Reply with quote

I found out it's resposible for udev too create "/dev/root" to link against the real root device ("/dev/sda3" in my case).
udev init script runs `/lib64/udev/write_root_link_rule` to do so, but it fails on (some of) my system.

I manually ran `udevadm info --export --export-prefix="ROOT_" --device-id-of-file=/`, but i got:
ROOT_MAJOR=0
ROOT_MINOR=13
and inside `write_root_link_rule` script it exits when it sees a "ROOT_MAJOR = 0".

I have another gentoo system which the command says:
ROOT_MAJOR=8
ROOT_MINOR=18
and the "/dev/root" is successfully linked to "/dev/sdb2"

both systems are using initrd.img created by `splash_geninitramfs` (splashutils-1.5.4.3).
both systems has "root=/dev/sda3" and "root=/dev/sdb2" in grub.cfg, respectively.

what am I missing?
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Sat Jul 30, 2011 8:28 am    Post subject: Reply with quote

Same problem here -- is there any solution? Up until yesterday udev/grub2 worked fine.
Back to top
View user's profile Send private message
hakcenter
n00b
n00b


Joined: 04 Dec 2011
Posts: 2

PostPosted: Sun Dec 04, 2011 9:52 pm    Post subject: Reply with quote

mbar wrote:
Same problem here -- is there any solution? Up until yesterday udev/grub2 worked fine.


I know this is a really really late reply.

I had been squandering my system, thinking my kernel was the problem, that grub2 was the problem... etc etc...

df -h
Code:

Filesystem            Size  Used Avail Use% Mounted on
rootfs                119G  7.2G  108G   7% /
/dev/root             119G  7.2G  108G   7% /


Problem is there is no /dev/root

grub2-probe /
Code:

grub2-probe: error: cannot find a device for / (is /dev mounted?).


ln -s /dev/sda2 /dev/root

grub2-probe /
Code:

btrfs


Crisis averted.


So does anyone know why /dev/root isn't being created or why df -h shows /dev/root when it should be /dev/sda2

/etc/fstab
Code:

/dev/sda2       /               btrfs           rw,ssd,noatime,compress=lzo     0 1
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Wed Feb 01, 2012 9:29 pm    Post subject: Reply with quote

I'm seeing the same issue at a new system of mine.

Using grub2, install works, but grub2-mkconfig only works with that ugly workaround "ln -s /dev/sda3 /dev/root". After a reboot the links is gone ofc. That is quite annoying. Are there any news regarding this bug?

Edit:
I switched to dracut tonight and now the problem seems to be gone. df shows /dev/sda3 insteaf of /dev/root.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum