djwong: (Default)
Bogus J. Simpson ([personal profile] djwong) wrote2013-09-28 10:56 pm

Whacking UEFI into booting Ubuntu 12.04 via grub2

Want to use UEFI 2.x to load grub2-efi and then the kernel? This is /fairly/ simple if you're already booted with BIOS/CSM.

(Hopefully you left enough space to create a EFI boot partition somewhere. It can be quite small.)

1. Format disk (say /dev/sdX) with GPT label. Use gdisk.
2. Create smallish partition (64MB) with type EF00 and name 'EFI System Partition'.
3. Format partition as FAT32.
4. mkdir /efiboot and make an fstab entry to automount the small partition.
5. Mount partition.
6. mkdir -p /efiboot/EFI/grub/ /efiboot/EFI/boot/
7. apt-get install grub-efi-amd64
8. grub-install /dev/sdX
9. cp /efiboot/EFI/grub/grub.efi /efiboot/EFI/boot/bootx64.efi
10. update-grub
11. Reboot. Enter F1 setup.
12. Create boot option for fsX:\EFI\grub\grub.efi named Ubuntu, then exit setup and boot it. If your UEFI won't let you create boot options, then system will find bootx64.efi from step 9 and use that instead.
13. When you're satisfied, go back to gdisk and tell it to recreate protective MBR. This erases your legacy grub2 installation.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting