Changing the Disk Identifier in the GRUB Configuration File to UUID

Scenarios

When optimizing a Linux private image, you need to change the disk identifier to UUID in the GRUB configuration file of the ECS.

Modify the menu.lst or grub.cfg configuration file (/boot/grub/menu.lst, /boot/grub/grub.cfg, /boot/grub2/grub.cfg, /boot/grub/grub.conf, or /boot/efi/EFI/euleros/grub.cfg), and configure the boot partition using the UUID.

The root partition identified in the configuration file varies depending on the OS. It may be root=/dev/xvda or root=/dev/disk.

Procedure