On Friday, 19 July 2019 10:29:09 BST Adam Carter wrote:
> This
> https://wiki.gentoo.org/wiki/GRUB2/Configuration_variables
> 
> has
> 
> GRUB_DISABLE_LINUX_UUID false If true, ${GRUB_DEVICE} is passed in the root
> parameter on the kernel command line.
> 
> If false, ${GRUB_DEVICE_UUID} is passed in the root parameter on the kernel
> command line when an initramfs is available.
> 
> So it looks like i can't set root= to a UUID unless i use an initramfs -
> can anyone confirm?

This would be correct if GRUB (with/out initramfs) happened to be the only way 
to configure Linux.  Thankfully we have more choices, in Gentoo at least.  ;-)


> In /usr/src/linux/admin-guide/kernel-parameters.txt it has;
> root=           [KNL] Root filesystem
>                         See name_to_dev_t comment in init/do_mounts.c.
> 
> And in do_mounts.c it mentions PARTUUID= and PARTLABEL= but i dont know C
> so don't know what to make of it.
> 
> Background is that after adding a new disk the system doesn't boot, so i'm
> assuming that the /dev/sdX device names are now pointing to different
> hardware, so i want to fix that by using persistent names.

You could use UUID, or partition label (if GPT is used on the disk), but by-
pass GRUB's facility to configure the UUID and use the kernel .config itself.  
For this you will have to configure and compile your own kernel.  Use this 
kernel option to specify kernel command line options:

Processor type and features -->
...

 [*] Built-in kernel command line
     (root=PARTUUID=XXXXXXXXXXXXXXXXXXXXXXXXX other_options_here)

As long as you use 'make oldconfig' for subsequent kernels the UUID will be 
retained.

-- 
Regards,

Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to