While mounting by UUID has some value for storage that is transient/mobile in nature (e.g., storage attached via USB, firewire, Lightning, perhaps even SCSI, eSATA or FibreChannel) it is IMHO the WORST POSSIBLE way to mount storage used to boot a system. UUID makes it IMPOSSIBLE to migrate a system and replace the boot drive without jumping through extraordinary hoops.
If there is ANY reasonable way to eliminate this rabid infatuation of UUID from an openSUSE system, please let me know,
I am particularly interested in eliminating UUID dependence in grub2-mkconfig and mkinitrd(dracut).
Even though i have
GRUB_DISABLE_LINUX_UUID=true
in /etc/default/grub, grub2-mkconfig insists on using UUID to figure out where grub.cfg exists. Which means that grub fails when the system is migrated to a different drive, it goes into a recovery console mode that writes characters temporarily in the middle of the screen before over-writing them with whatever was already being displayed. In effect, it’s useless.
the grub.cfg file gets loaded with lines like this
# grep uuid /boot/grub2/grub.cfg
search --no-floppy --fs-uuid --set=root --hint='lvmid/IAs7dd-2SVj-zCIo-eHYB-7vxV-Mt7H-dq05OR/MMh1yb-2vvI-Xcdf-wT6J-Y7at-6qwd-Xb5vFm' 6de884c2-d5cb-45a4-9e66-1e34ccaa3b19
search --no-floppy --fs-uuid --set=root 6de884c2-d5cb-45a4-9e66-1e34ccaa3b19
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root 14edeeda-cb10-4467-9993-126da8b63626
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 7EB1-87B3
search --no-floppy --fs-uuid --set=root 7EB1-87B3
So I have to boot from a liveCD to edit the file, replacing all instances of --fs-uuid with -l and the uuids of the old drive with the labels of the respective file systems.
While that allows grub to function, we’re not home yet. Mkinitrd(dracut) also insists on using uuid, so booting fails after grub passes control to the kernel. The reason is fails is because the uuid of the root filesystem is different on the new drive than on the old drive, so it can’t mount the root filesystem. I could use tune2fs to change the uuid if I was using a drive partition for a singe filesystem, such that formatting .e.g. /dev/sda3 to ext4 yiels a single filesystem. That doesn’t work so well if a single disk partition encompasses multiple logical volumes. The user has no controll over the uuid applied to either a VG nor an LV. The result is entries in the initrd which look like
drwxr-xr-x 2 root root 0 Jan 21 08:30 etc/systemd/system/dev-disk-by\\x2duuid-14edeeda\\x2dcb10\\x2d4467\\x2d9993\\x2d126da8b63626.device.d
-rw-r--r-- 2 root root 0 Jan 21 08:30 etc/systemd/system/dev-disk-by\\x2duuid-14edeeda\\x2dcb10\\x2d4467\\x2d9993\\x2d126da8b63626.device.d/timeout.conf
drwxr-xr-x 2 root root 0 Jan 21 08:30 etc/systemd/system/dev-disk-by\\x2duuid-7EB1\\x2d87B3.device.d
-rw-r--r-- 2 root root 23 Jan 21 08:30 etc/systemd/system/dev-disk-by\\x2duuid-7EB1\\x2d87B3.device.d/timeout.conf
drwxr-xr-x 2 root root 0 Jan 21 08:30 etc/systemd/system/initrd.target.wants
lrwxrwxrwx 1 root root 78 Jan 21 08:30 etc/systemd/system/initrd.target.wants/dev-disk-by\\x2duuid-14edeeda\\x2dcb10\\x2d4467\\x2d9993\\x2d126da8b63626.device -> ../dev-disk-by\\x2duuid-14edeeda\\x2dcb10\\x2d4467\\x2d9993\\x2d126da8b63626.device
lrwxrwxrwx 1 root root 42 Jan 21 08:30 etc/systemd/system/initrd.target.wants/dev-disk-by\\x2duuid-7EB1\\x2d87B3.device -> ../dev-disk-by\\x2duuid-7EB1\\x2d87B3.device
So the kernel halts at a dracut recovery prompt because it can’t find the root filesystem. Unfortunately, my attempts to mount the real filesystem fail. I’ve been trying
mount -o remount /dev/mapper/<VGname>-<LVname> /
and
mount -o remount /dev/dm-1 /
or
mount -o remount /dev/disk/by-label/<root-volume-label> /
but they all fail to mount the root filesystem.
I’d really like to get the new drive installed in the system before the old drive fails completely, but UUID is making this VERY difficult. The only way I can see to make the system less flexible and useable would be to apply UUID to the keyboard, mouse, monitor and memory as well as the storage. I wonder when that’s coming. >:)
If there’s any way out of this UUID-hell, I’d sure appreciate learning about it.
Thanks,
ron