Upgrading a grub/grub2 Configuration for EFI Hosts to Use UUID Disk Identifiers

Article ID: 77906

Article Type: Technical Reference

Last Modified:

Obtain the UUID of the root partition and configure the boot item in config file to use the UUID of the root partition, as follows:

  1. Log in as root user.
  2. Run the following command to query all types of mounted file systems and device UUIDs:

  1. As a precaution, make a copy of the GRUB configuration files as follows:
# cp /etc/default/grub /etc/default/grub-backup
# cp /boot/grub/grub.cfg /boot/grub/grub.cfg-backup

  1. Run the following command to query the grub.cfg file:
# cat /etc/default/grub

This file contains multiple GRUB2 options. Kernel boot parameters are specified by the GRUB_CMDLINE_LINUX option.

  1. Check whether the root partition in the /boot/grub/grub.conf configuration file contains root=UUID=f382872b-eda6-43df-9516-5a687fecdce6 or root=/dev/xvda2.

* If the file contains root=UUID=f382872b-eda6-43df-9516-5a687fecdce6, the root partition is in the UUID format and requires no change. * If the file contains root=/dev/xvda2, the root partition is in the device name format. Go to Step 6.

  1. Identify the UUID of the root partition device based on root=/dev/xvda2 (device name of the root partition) and the partition information obtained by running the blkid command.
  2. Run the following command to open the grub.conf file in the vi editor:
# vi /etc/default/grub

  1. Press i to enter editing mode, and then change the root partition to the UUID format (for example, change from root=/dev/xvda2 to root=UUID=f382872b-eda6-43df-9516-5a687fecdce6).
  2. Press ESC, enter :wq, and then press ENTER.  The system saves the configuration and then exits the vi editor.
  3. Save the file and then run the following command to generate a new grub.cfg file:
# grub2-mkconfig -o /etc/default/grub

  1. To apply all changes, reboot the system by entering the following command:
# systemctl reboot

Note: For some machines, the grub configuration file might be different from BIOS. In that case, look for the following files:

1 Commvault Way, Tinton Falls, NJ 07724 Sitemap | Legal Notices | Trademarks | Privacy Policy
Copyright © 2022 Commvault | All Rights Reserved.