Skip to contentSkip to conversation

grub 1.99 configuration

DISCUSSION Bruce Dubbs 3 participants 6 messages Jun 12, 2011 – Jun 24, 2011

lore
Share & tools
lore
#0 lore raw

I'm trying to manually run grub-mkconfig to establish grub-1.99 installation instructions for Linux From Scratch.

I am getting:

grub-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub-probe: error: cannot stat `/dev/root'

Doing some investigating grub-mkconfig is running:
/usr/sbin/grub-probe --target=device /

Drilling down, grub-probe is doing:
device_name = grub_guess_root_device (path);

Which in turn is doing:
grub_find_root_device_from_mountinfo( "/", NULL );

This is reading /proc/self/mountinfo. The problem here is that this file does not give the device, but specifies /dev/root:

13 1 8:15 / / rw,relatime - ext3 /dev/root rw,errors=continue,barrier=0,data=writeback

The kernel is 2.6.39.1, but 2.6.37 seems to give the same thing. grub-probe should be able to detect /dev/sda15, but fails on newer kernels.

grub-probe for grub-1.98 works fine. A grep there shows no use of /proc/self/mountinfo.

Suggestions?

-- Bruce

#1 lore raw
Quoted 2 lines · Bruce Dubbs

grub-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub-probe: error: cannot stat `/dev/root'

http://bugs.debian.org/627587

You can fix it by backporting r3318 from trunk:

http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3318

The backport to 1.99 is not entirely straightforward. Here's a version that works with 1.99:

http://anonscm.debian.org/loggerhead/pkg-grub/trunk/grub/revision/2435/debian/patches/lazy_stat.patch

Signature · 1 line
Colin Watson                                       [[email protected]]
#2 lore raw
Quoted 6 lines · Colin Watson
Quoted 2 lines · Bruce Dubbs

grub-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub-probe: error: cannot stat `/dev/root'

http://bugs.debian.org/627587

Quoted 8 lines

You can fix it by backporting r3318 from trunk:

http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3318

The backport to 1.99 is not entirely straightforward. Here's a version that works with 1.99:

http://anonscm.debian.org/loggerhead/pkg-grub/trunk/grub/revision/2435/debian/patches/lazy_stat.patch

Thanks for the info. I'll check it out.

-- Bruce

#3 lore raw
In reply to Bruce Dubbs
Quoted 23 lines · Bruce Dubbs

I'm trying to manually run grub-mkconfig to establish grub-1.99 installation instructions for Linux From Scratch.

I am getting:

grub-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub-probe: error: cannot stat `/dev/root'

Doing some investigating grub-mkconfig is running:
/usr/sbin/grub-probe --target=device /

Drilling down, grub-probe is doing:
device_name = grub_guess_root_device (path);

Which in turn is doing:
grub_find_root_device_from_mountinfo( "/", NULL );

This is reading /proc/self/mountinfo. The problem here is that this file does not give the device, but specifies /dev/root:

13 1 8:15 / / rw,relatime - ext3 /dev/root
rw,errors=continue,barrier=0,data=writeback

Quoted 9 lines

The kernel is 2.6.39.1, but 2.6.37 seems to give the same thing. grub-probe should be able to detect /dev/sda15, but fails on newer kernels.

grub-probe for grub-1.98 works fine. A grep there shows no use of /proc/self/mountinfo.

Suggestions?

update either udev or grub. normally /dev/root should be a symlink. Newer grub-probe can cope with some other arrangements as well

Quoted 10 lines

-- Bruce

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#4 lore raw
Quoted 28 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 27 lines · Bruce Dubbs

I'm trying to manually run grub-mkconfig to establish grub-1.99 installation instructions for Linux From Scratch.

I am getting:

grub-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub-probe: error: cannot stat `/dev/root'

Doing some investigating grub-mkconfig is running:
/usr/sbin/grub-probe --target=device /

Drilling down, grub-probe is doing:
device_name = grub_guess_root_device (path);

Which in turn is doing:
grub_find_root_device_from_mountinfo( "/", NULL );

This is reading /proc/self/mountinfo. The problem here is that this file does not give the device, but specifies /dev/root:

13 1 8:15 / / rw,relatime - ext3 /dev/root
rw,errors=continue,barrier=0,data=writeback

The kernel is 2.6.39.1, but 2.6.37 seems to give the same thing. grub-probe should be able to detect /dev/sda15, but fails on newer kernels.

Quoted 7 lines
Quoted 5 lines

grub-probe for grub-1.98 works fine. A grep there shows no use of /proc/self/mountinfo.

Suggestions?

update either udev or grub. normally /dev/root should be a symlink. Newer grub-probe can cope with some other arrangements as well

Well I'm using udev-171. That is the most recent version. We don't like to non-release package versions in LFS, but we do occasionally patch files.

I don't know when /dev/root became a 'device'. Udev doesn't create it.
We also don't use an initrd. That's not needed when you know in
advance what your hardware configuration is.

I did work around the problem by manually creating the symlink. I do not know of anything other than GRUB that needs it, but I don't use lvm.

In any case, I don't think GRUB should choke because /dev/root is missing.

-- Bruce

#5 lore raw
Quoted 45 lines · Bruce Dubbs
Quoted 28 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 27 lines · Bruce Dubbs

I'm trying to manually run grub-mkconfig to establish grub-1.99 installation instructions for Linux From Scratch.

I am getting:

grub-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub-probe: error: cannot stat `/dev/root'

Doing some investigating grub-mkconfig is running:
/usr/sbin/grub-probe --target=device /

Drilling down, grub-probe is doing:
device_name = grub_guess_root_device (path);

Which in turn is doing:
grub_find_root_device_from_mountinfo( "/", NULL );

This is reading /proc/self/mountinfo. The problem here is that this file does not give the device, but specifies /dev/root:

13 1 8:15 / / rw,relatime - ext3 /dev/root
rw,errors=continue,barrier=0,data=writeback

The kernel is 2.6.39.1, but 2.6.37 seems to give the same thing. grub-probe should be able to detect /dev/sda15, but fails on newer kernels.

Quoted 7 lines
Quoted 5 lines

grub-probe for grub-1.98 works fine. A grep there shows no use of /proc/self/mountinfo.

Suggestions?

update either udev or grub. normally /dev/root should be a symlink. Newer grub-probe can cope with some other arrangements as well

Well I'm using udev-171. That is the most recent version. We don't like to non-release package versions in LFS, but we do occasionally patch files.

I don't know when /dev/root became a 'device'. Udev doesn't create it. We also don't use an initrd. That's not needed when you know in advance what your hardware configuration is.

Quoted 6 lines

I did work around the problem by manually creating the symlink. I do not know of anything other than GRUB that needs it, but I don't use lvm.

In any case, I don't think GRUB should choke because /dev/root is missing.

it's fixed now but handling these cases requires to scan /dev to find the matching device based on major/minor pair which is slower, sometimes much slower.

Quoted 6 lines

-- Bruce

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko