Start a Ubuntu Linux (14.04) Live CD in UEFI mode. In case of a USB boot device, disable "Fast Boot" in UEFI.
Open a terminal window (Ctrl+Alt+T)
To verify that you are actually running in UEFI mode, use this bash command:
$ [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
The resulting output should be:
UEFI
In case it says BIOS
, reboot into your firmware and correct the boot device preference.
To do the BIOS to EFI/UEFI conversion enter these commands:
$ sudo mount /dev/sda1 /mnt
$ sudo mkdir -p /mnt/boot/efi
$ sudo mount /dev/sda3 /mnt/boot/efi
$ sudo mount --bind /dev /mnt/dev
$ sudo mount --bind /proc /mnt/proc
$ sudo mount --bind /sys /mnt/sys
$ sudo mount --bind /run /mnt/run
$ modprobe efivars
$ sudo chroot /mnt
# apt-get install grub-efi-amd64
Apt-get networking failure?
# rm /etc/resolv.conf
# ln -s ../run/systemd/resolve/stub-resolv.conf resolv.conf
# apt-get install grub-efi-amd64
No apt-get failure
The following extra packages will be installed:
efibootmgr grub-efi-amd64-bin
The following packages will be removed:
grub-gfxpayload-lists grub-pc
...
After this operation, 2,399 kB of additional disk space will be used.
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck --no-floppy --debug
Despite ending in error message:
Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.
the next reboot already shows "ubuntu" in the firmware its boot options menu, and boots to the console as before, except for now booting in efi mode:
$ dmesg | grep EFI
efi: EFI v2.31 by American Megatrends
fb0: EFI VGA frame buffer device
EFI Variables Facility v0.08 2004-May-17
fb: switching to inteldrmfb from EFI VGA
In case something goes wrong, https://superuser.com/questions/376470/how-to-reinstall-grub2-efi might help.
First, your problem of an inability to boot the installer in EFI mode was most likely the result of one or more of three things:
- An incorrectly-prepared boot medium -- To boot in EFI mode, a boot medium must have an EFI-mode boot loader. Not all tools for creating bootable USB disks from
.iso
images, though, copy the necessary EFI boot loader files. Most notably, Pen Drive Linux (aka YUMI) does not create these files. Most other tools do create these files, but you might have used some obscure tool that does not. The solution to this problem is to use another tool to create the boot medium.
- Incompatibility between your EFI and your boot medium -- On occasion, a disk that boots fine in EFI mode on one system will fail to boot in EFI mode on another one. This is because of quirks in the boot medium and in the EFI implementations. The solution, as in the previous case, is to use another tool to create the boot medium.
- User error during the boot process -- You may need to select specific options to boot in EFI mode. Most importantly, your firmware must be configured to boot in EFI mode rather than in BIOS/CSM/legacy mode. You may also need to select the correct boot option; in many cases, you'll see two options to boot an external disk, one of which includes the string UEFI and the other of which does not. To boot in EFI mode, you must select the option that includes the string UEFI; the other option will boot in BIOS mode.
If you start the installer in BIOS mode, then the same tools and procedures will most likely start the Boot Repair utility in BIOS mode, too, and that will make a 100% complete and proper installation of an EFI-mode boot loader impossible. (There can be workarounds and hackish install of EFI-mode boot loaders from a BIOS-mode boot, though.)
You can read more about the problems with controlling BIOS-mode vs. EFI-mode booting on my Web page on the subject. Note that some online tutorials for installing Linux, especially older tutorials, give horrible advice on EFI mode; they recommend enabling the BIOS/CSM/legacy support (which is almost always a mistake) and ignore the issue of using appropriate tools for creating a bootable medium. My CSM page is intended to set the record straight on these issues.
In your specific case, I recommend you download and prepare the USB flash drive or CD-R version of my rEFInd boot manager. This tool works only in EFI mode, so if you can get it to boot, you're guaranteed that you're running rEFInd itself in EFI mode. On UEFI-based PCs, rEFInd defaults to booting only EFI-based OSes, so if you can boot Ubuntu from the rEFInd menu, Ubuntu will then be booted in EFI mode. You can then install rEFInd using its PPA or Debian package, run Boot Repair, or manually install the EFI version of GRUB. Any of these actions should get your computer booting in EFI mode directly, without using the rEFInd USB drive or CD-R.
Before you go too far down this road, though, you should check your current Windows boot mode (as describe on this page of mine) and your partition table. Based on your description, I suspect you're booting Windows in EFI mode from a GPT disk, which makes booting Ubuntu in EFI mode desirable, too; however, you should verify this to be 100% sure before you start messing with your permanent boot loader installation.
Best Answer
Some early Intel Macs with 64 bit processors had only a 32 bit EFI in the firmware. There used to be versions of Ubuntu installers which would create a BIOS booting GRUB. However, GRUB still recognized and used the GPT partitioning table. In these cases, the drives were hybrid partition only because the Mac firmware would not BIOS boot unless there was hybrid partitioning. Once Ubuntu was booted by GRUB, Ubuntu would ignore then hybrid partitioning and only use the GPT.
At least since 2007, all Intel Macs have a 64 bit EFI. For these Macs, Ubuntu should be installed to 64 bit EFI boot even if the EFI is not UEFI compliant. Any hybrid partitioning is ignored by GRUB and Ubuntu.
In conclusion, there is no good reason to hybrid partition for the sole purpose of installing Ubuntu on a 2012 Mac. If you already have Window installed to BIOS boot, then Ubuntu can be installed to EFI boot and will ignore the hybrid partitioning.