Web lists-archives.com

Re: drive names and UUIDs, was Re: Intresting dd fsck grub uuid fstab action




Le 03/06/2017 à 18:04, David Wright a écrit :

AIUI there's a race condition here, perhaps even several. The correct
MBR should be read as normal by the BIOS, but grub then searches
by UUID for the kernel/ramdisk, and the kernel searches by UUID for
the root filesystem, and  we don't know how it chooses between them.

Note that the kernel does not know anything about filesystem UUIDs (stored in filesystem metadata). It only knows about partition UUIDs (stored in partition tables). The part that uses UUIDs to locate the root filesystem is the initrd/initramfs userland scripts, with the help of libblkid/udev.

Do they (a) take the UUID being searched for and look at each disk/
partition's UUID for a match, or (b) read all the available UUIDs into
a table (overwriting any duplicates by the new entry) and then take
the UUID being searched for and look it up in the table? These
strategies give opposite results.

I think GRUB does the former and libblkid/udev does the latter.