I have a 64-bit system running Arch Linux. MBR and its extended partition is a PITA. I’ve been using GRUB-Legacy far too long to see its limitations. Official support was recently dropped. So now is a good time to update from both in one go.

This is my log of how I did it. It worked for me, it might not work for you. I omit the details and specific commands and provide source links instead. Have a general understanding of what you are doing. If you do not need/want UEFI, or GPT, or GRUB2, if you don’t see the benefits of either, or if you not know what modprobe does, this “guide” is not for you.

Read the entire post before you do anything.

  1. Make full system backup.
  2. Make rescue media. I have GParted Live, SystemRescueCD, Archboot, Linux Mint and Ubuntu. Get your own and learn to use it.
  3. Edit partition table. Make space for a UEFISYS partition, leave space at the beginning and end of hard drive for the GPT.
  4. Backup MBR. Also, copy this backup to external backup media.
  5. Reboot, enable EFI and see if you can boot. If so, you’re good to go. If not, reboot in BIOS mode. Continue at your own risk. You will have to use GRUB rescue mode later.
  6. modprobe efivars to enable efibootmgr operation. If /sys/firmware/efi is populated, you’re good to go. If not, continue at your own risk. You will have to use GRUB rescue mode later.
  7. Convert from MBR to GPT.
  8. Create the UEFISYS partition.
  9. Backup GRUB-Legacy.
  10. Install grub-efi-x86_64.
  11. If 'modprobe efivars' worked previously, you’re more or less done.

If it didn’t work, 'grub-install' will fail with

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.

After all, it’s still booted in BIOS mode without UEFI.

  1. Reboot, enter UEFI menu and boot through GRUB2 rescue mode.
  2. Reinstall grub-uefi boot files.
  3. Break open the champagne. If not, set yourself on fire and run in circles.

Published July 23 2012 by veox