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.
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.
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.
Run the following command to open the grub.conf file in the vi editor:
# vi /etc/default/grub
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).
Press ESC, enter :wq, and then press ENTER. The system saves the configuration and then exits the vi editor.
Save the file and then run the following command to generate a new grub.cfg file:
# grub2-mkconfig -o /etc/default/grub
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: