Installing Maverick on new Sandy Bridge systems using GPT + EFI

Jason Gunthorpe jgunthorpe at
Thu Jan 13 19:26:45 UTC 2011

Hi all,

I just got this to work and thought I'd share my thoughts and method for
others. First, the goal is to install Windows 7 and Maverick onto a GPT
formatted disc and EFI boot both of them. I'm using a new Asus P8H67 EVO
motherboard (ie this isn't a Mac).

Here is the summary:
 1) The USB stick created via usb-creator-gtk is not EFI bootable. This is
easy to fix - inside the vfat boot/grub/efi.img is efi/boot/bootx64.efi -
this needs to be copied to efi/boot/bootx64.efi on the USB stick itself.
IMHO, the CD ISO should be created with this file extracted as well so that
usb-creator-gtk 'just works'. Having this file is enough for the BIOS to
present 'UEIF: 0.0' as a boot option for the USB stick.
 2) The grub in bootx64.efi does not contain part_msdos and maybe also fat.
This means it cannot read the USB stick, but I get the grub prompt. Using
another Ubuntu machine to re-run grub-mkimage and including those modules
(plus part_gpt) resulted in a working grub and with a tish of fussing the
grub CD menu came up. Yay.
 3) The grub 0.98 has a known bug where it corrupts the initrd when EFI
booting. Update the grub and modules on the stick to 0.99. Now Ubuntu boots
 4) gparted worked great, resized the GPT NTFS partition, I setup LVM as I
tend to do, and proceeded to install. gparted does have a bad bug though,
after I created LVM parition it crashed and refused to start again with more
crashing. I used parted to name the lvm part, tag it as lvm and
pvcreate/vgcreate gparted worked again.
 5) The install bailed trying to setup grub-pc - grr, why didn't it detect
it should use grub-efi-amd64? chroot into the target and fix it up. Also
install 0.99 since I know 0.98 doesn't work. 0.99 is broken, grub-install
dies for several reasons. Piddle and fix that up.
 6) The broken grub-install doesn't call efibootmgr properly, fix that..

Reboot, and success!

It looks to me like this is really close to working 'out of the box'. I'd
say the things that need fixing to make this correct:
 1) Include fat, part_msdos, and part_gpt in the grub-efi image
 2) Install the grub-efi image in efi/boot/bootx64.efi as well as the .img
file on the ISO
 3) Patch grub to not corrupt the initrd
 4) Have support in gparted to create the initial GPT disklabel with the
necessary system partition automatically (I used Windows 7 to do this)
 5) Fix the installer to mount the EFI system partition under
target/boot/efi/ and add that to fstab
 6) Fix the installer to use grub-efi-amd64 not grub-pc

Other than that, it seems to work OK, next problems are: non-accelerated
graphics, the kernel panics on reboot in EFI, a few funny kernel messages..
Nothing too bad.

I'll still have this system in a state where I can wipe the disk if anyone
would like any more infos or to test something..

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Ubuntu-installer mailing list