6

while learing and adjusting my boot setup, I am stuck unterstanding this content in my grub.cfg on the EFI patition of my drive:

search.fs_uuid <uuid> root hd8,gpt5
set prefix=($root)'/boot/grub'

My hunch is that this finds a specific UUID, sets this as root, then sets root to hd8,gpt5 and then sets the prefix with that root-var setup in order to find the grub loader at the right place.

Now hd8,gpt5 and the uuid are my troubles. My drive with this grub.cfg and EFI folder has the /boot/grub on the fith partition and is a gpt drive - so gpt5 seems ok.

hd8 seems odd, as I do boot this drive I would have expected it to be hd0.

And the uuid I thought it should be the one of the gpt5 partition, but maybe this should be the drives uuid?!

Could someone please explain what is happening here and what the correct values for /boot/grub on a fitht partition of a gpt drive should be? Thanks!

2 Answers 2

3

hd8,gpt5 is just a hint for GRUB, which is used when uuid is found more than once (multiple partitions with the same UUID).

A full version of the first line could look like:

search --set=root --fs-uuid <uuid> --hint hd8,gpt5

That hint could be, in the most cases, safely omitted (or fixed to actual values without any risk of ending up with an unbootable system).

0

Content of grub.cfg on ESP (EFI Partition)

Content of grub.cfg on ESP (EFI Partition)

UUID is the unique partition guid as mentioned in section 5 of UEFI Spec

As you can see in the image, the root partition has a 16-byte unique GUID and as BIOS looks into ESP for bootmanger/bootloader/OS loader, it finds that root partition. /boot/grub has the mentioned grub.cfg to load the bootmanager / bootloader in case of Ubuntu OS loading.

Hope this explanation helps..

1
  • Partition UUID and filesystem UUID are different things. Both grub.cfg from OP and yours clearly refer to filesystem one.
    – temoto
    Mar 13 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.