[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /boot/grub/grub.cfg hex number reference



On Wed 13 Mar 2024 at 18:59:30 (+0000), Gareth Evans wrote:
> On Wed 13/03/2024 at 12:50, Michel Verdier <mv524@free.fr> wrote:
> > On 2024-03-13, Gareth Evans wrote:
> >
> >> That suggests perhaps something to do with an FS UUID, but it doesn't seem to appear in the output of any of
> >>
> >> # blkid
> >
> > Here I have them shown as UUID by blkid
> >
> > # grep root /boot/grub/grub.cfg 
> > ...
> > search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 
> > --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  
> > 5210342e-548e-4c4d-a0e9-a5f6d13888d6
> > ...
> >
> > # blkid|grep -i 5210342e
> > /dev/sdb2: UUID="5210342e-548e-4c4d-a0e9-a5f6d13888d6" ...
> >
> > hint-bios=hd0,gpt3 suggests its your 3rd partition on your first disk.
> >
> > Do you use raid ?
> 
> Hi Michael,
> 
> I'm currently using a single disk with ZFS, partitioned as 

I don't know anything about ZFS …

> $ sudo fdisk -l /dev/sda
> <snip>
> Disk identifier: 3405...
> Device       Start       End   Sectors   Size Type
> /dev/sda1       48      2047      2000  1000K BIOS boot
> /dev/sda2     2048   1050623   1048576   512M EFI System
> /dev/sda3  1050624   3147775   2097152     1G Solaris /usr & Apple ZFS
> /dev/sda4  3147776 250069646 246921871 117.7G Solaris root

… or what Solaris /usr & Apple ZFS and Solaris root mean.

[ … ]

> So after making some sense of grub-mkconfig.in, it turns out the 16-digit hex number is returned by
> 
> # grub-probe --device /dev/sda3 --target=fs_uuid
> 9cbef743dfafd874

I'd be interested to know what   grub-probe --device /dev/sda3 --target=fs
thinks the filesystem is. It may just follow what udev says, in which
case I'd look at the contents of /run/udev/data/b8\:3 (guessing¹).

BTW there's no necessity for the UUID to be 32 hex digits; for
example,   grub-probe --device /dev/sda2 --target=fs_uuid
will give you something more like C027-B627.

> Given that the above command fails with 
> 
> --device /dev/sda4 
> 
> (which is the running system's /), gpt3 appears to be sda3, ie. the boot partition,

If you say so.

> so 
> 
> --set=root
> 
> in the grub.cfg search line presumably relates to the root of /boot.

Yes, confusingly, AIUI, the root of  --set=root  is nothing necessarily
to do with the   root=   in the linux line.

> I'm still curious as to why it doesn't seem to appear anywhere else, how it was applied, and what exactly it applies to - a filesystem?

The answer to that may lie with ZFS.

> This is not aiui the usual form of a UUID either.

As mentioned above.

> grub-probe.in or grub-install.c might hold answers.

AFAIK grub-install requires a system device name (like /dev/sda) or
something that points to it (like the /dev/disk/ symlinks).

¹ I've guessed for partition three on the first HDD. For an nvme SSD,
  it could be /run/udev/data/b259\:3 or some other b-number. It's
  usually pretty obvious from a directory listing because of the
  :0 :1 :2 … corresponding partition numbers.

Cheers,
David.


Reply to: