Grub Root line in Menu

If one drops into edit on the grub boot menu amongst other entries is:-

set root=‘hdo,msos3’
linux /boot/vmlinuz********** root=UUID=

Are the two root entries different? I seem to recall that if the UUID is not used then the disk and partition is given in the normal Linux method, eg sda3 whereas the first entry is the original msdos method.

I’ve noticed too that if I boot to an external drive the drive identification alters so the 'set root=‘hd0,msdos3’ line is effectively wrong but it still seems to boot OK

Geoff

set root= set root device for grub (and uses grub’s device designation). As far as I can understand it can be used multiple times throughout grub.cfg

Simplest way to test it or feel it, so to say, is to drop into grub interactive mode, set root and then try cat some file or open another grub config with configfile directive.

Basically

set root=‘hd0,msdos3’
cat /grub2/grub.cfg

is equivalent to

cat (hd0,msdos3)/grub2/grub.cfg

– i.e. you can set root once so that you don’t have to enter in on every other line.

Also note that tab completion works in grub’s cli interface, it helps greatly with finding files you need.

Here’s it explained a bit in grub’s manual:

https://www.gnu.org/software/grub/manual/grub/grub.html#File-name-syntax


Root in the line linux... is setting root partition (not grub’s root device!) for linux kernel. grub itself doesn’t need it or use it – it’s just passes it as is to Linux kernel. If you don’t set root here or set it incorrectly – Linux won’t be able to boot.

From grub’s manual:

Command: linux file
Load a Linux kernel image from file. The rest of the line is passed verbatim as the kernel command-line .

You’re right, as far as I know, here you can use the same notations an in /etc/fstab.

Does this answer you question?

1 Like

It certainly does, thank you. Slowly getting the hang of it.

Still struggling a bit with the actual menu, on your advice I am able to add custom boot entries (copy and paste) but unsure how to delete entries that are already there.

Getting there though.

Geoff

You do it by disabling os prober for grub, as I’ve written there. Only current Fedora’s options will remain – as well as the ones you’ll add yourself.

I suggest discussing it further here: