How to change grub2 in CentOS/RHEL7 from UUID to old style device

centos7grub2rhel7uuid

With CentOS/RHEL 7 there are a couple of changes (compared to CO/RHEL 6).
One of it is the use of grub2 instead of grub.

Per default the OS seems to use a UUID to "find" the boot-device.

Is there an easy to use receipe to get back to device-names (like /dev/sda1) instead?

Background of the question:
I am intending to clone additional VMs from a template. Base is a new (virtual) disk device with a different UUID.

If I can not revert to sda1 I will need to change the UUID of the clone in the grub.cfg to the new UUID – which is plan "B".

Update 2017-10-26

The kernel-parameter for root= will be changed to the disk – see the answer from Thomas below.

There remains a problem with this section, generated by grub2-mkconfig:

    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  716433ab-9e30-42a7-a272-6c66243499d2
    else
      search --no-floppy --fs-uuid --set=root 716433ab-9e30-42a7-a272-6c66243499d2
    fi

This still contains the search for the UUID. If it can't be found, the boot-process will go to error "not found" or something like that. After pressing ENTER the system will boot up ok.

The remaining Q is how to inactivate that section (I did not find the place to disable the feature_platform_search_hint)?

Best Answer

This is possible by adding the parameter as follows to /etc/default/grub.

$ echo "GRUB_DISABLE_LINUX_UUID=true" >> /etc/default/grub
$ grub2-mkconfig -o /boot/grub2/grub.cfg

If you want to double check the result before.

$ grub2-mkconfig | less

Update

To completely disable the UUID in GRUB, you need to add the line as follows to /etc/sysconfig/grub

$ echo "GRUB_DISABLE_UUID=true" >> /etc/default/grub
$ grub2-mkconfig -o /boot/grub2/grub.cfg