Home‎ > ‎Server config‎ > ‎

How to convert RHEL system from UEFI & GPT to legacy BIOS & MBR

Issue

  • How can I convert a RHEL system from using UEFI to using legacy BIOS?
  • Is it possible to conver boot LUN from GPT to MBR without losing data and configuration?
  • How to convert boot LUN from GPT to MBR (i.e. UEFI boot to Legacy Only)?
  • The machine is installed with UEFI boot enabled, now is it possible to make it Legacy only?

Resolution

  1. Before beginning: Make a backup of the main disk
    The following steps have been tested by engineers in Red Hat Support; however, the risk of mistakes causing damage is high when using programs that modify partition tables, so taking a backup first is highly recommended

  2. Install the gdisk package if it's not already installed

    yum install gdisk
  3. Use the gdisk command to convert the main disk's GPT to MBR
    (Replace /dev/sda as appropriate)

    gdisk /dev/sda <<EOFrga2t283wyEOF
  4. Reconfigure GRUB
    (Replace /dev/sda as appropriate)

    • RHEL 6

      cp -a /boot/efi/EFI/redhat/grub.conf /boot/grub/grub-install /dev/sda
    • RHEL 7

      rm -f /etc/grub2-efi.cfg /boot/grub2/grubenvyum install grub2grub2-install --target=i386-pc /dev/sdagrub2-mkconfig | sed -r 's/(linux|initrd)efi/\116/' >/etc/grub2.cfg