I have a bunch of x86_64 CentOS 9 Stream VMs that are all set up to use UEFI. That's great, except that my backup appliance, it turns out, won't take UEFI + GPT. I can do BIOS + GPT, however, so that is what I'm trying to do. The problem is that I am no GRUB expert.
Currently these VMs use two virtual disks -- sda is a boot drive (MBR/ext4), and sdb is for OS + data (GPT/LVM/XFS). sda1 is /boot/efi and sda2 is /boot.
My theory was the following but the VM doesn't boot after the change (and yes, I'm changing the VM's properties to use BIOS firmware and not UEFI firmware).
Code: Select all
dnf install grub2-pc
parted /dev/sda1 set partition-number bios_grub on
grub2-install --target=i386-pc /dev/sda
grub2-mkconfig |awk '{gsub("linuxefi /", "linux /");gsub("initrdefi /", "initrd /");print $0}' > /boot/grub2/grub.cfg
Power down the VM and change the boot firmware to BIOS. Power back up.
Any suggestions for a GRUB newbie? Thanks!