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

В CentOS / RHEL 7 есть пара изменений (по сравнению с CO / RHEL 6). Одним из них является использование grub2 вместо grub .

По умолчанию ОС, похоже, использует UUID для "поиска" загрузочного устройства.

Есть ли там простой в использовании рецепт, чтобы вместо этого вернуться к именам устройств (например, / dev / sda1)?

Предыстория вопроса: 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
 поиск --no-floppy --fs-uuid --set = root 716433ab-9e30-42a7-a272-6c66243499d2
 фи

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)?

1
задан 26 October 2017 в 11:55
1 ответ

Это возможно, добавив следующий параметр в / etc / default / grub .

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

Если вы хотите дважды проверить результат раньше.

$ grub2-mkconfig | less

Обновить

Чтобы полностью отключить UUID в GRUB , вам нужно добавить следующую строку в / etc / sysconfig / grub

$ echo "GRUB_DISABLE_UUID=true" >> /etc/default/grub
$ grub2-mkconfig -o /boot/grub2/grub.cfg
6
ответ дан 3 December 2019 в 16:44

Теги

Похожие вопросы