Broadly speaking, there are two ways to get this going, but there are lots of variants within both categories. Note that you should understand your partition table layout before you begin. I recommend you type sudo gdisk -l /dev/sda
from an emergency Linux disk. Among other things, this will show something like this:
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
This example shows a pure GPT disk -- GPT: present
means that the disk is a GPT disk, and MBR: protective
means that it's a standard legal GPT disk. If it instead reads MBR: hybrid
and GPT: present
, that identifies a GPT disk with a hybrid MBR; and if it reads MBR: MBR only
and GPT: not present
, that identifies a pure-MBR disk. Which disk type you've got determines how the Mac's firmware might behave, as detailed shortly.
You should also look for a partition with a Code
column of EF00
. If present, this is an EFI System Partition (ESP), which is important for EFI-mode booting.
With this information in hand, you can begin considering your boot-mode options....
BIOS/CSM/Legacy-Mode Installation
For a Linux-only installation on a Mac, a BIOS/CSM/legacy-mode install on a pure-MBR disk is generally simplest. This causes the Mac to boot in BIOS mode, bypassing the need to configure EFI boot variables. Precisely how to get to this state from where you are, though, depends on your current disk layout. Possible steps include:
- Boot to a Linux emergency system.
- Convert the hard disk from GPT to MBR. This step might or might not be necessary, depending on the disk's current state. See this documentation (part of my
gdisk
documentation) for general information. Note that, if you have more than four partitions, or expect to need more than four in the future, you'll need to set up some partitions as logical, and there are placement issues with that. I can't be more precise without knowing the sector-precise current partition layout.
- Install a BIOS-mode boot loader. For Ubuntu and related distributions, the easiest way to do this is with Boot Repair. I can't promise this tool would work well with other distributions, though. You may need to do it manually, and I'm afraid I don't have ready pointers on this task. Some distributions install GRUB manually as part of the OS installations, and for them, their installation instructions should tell you how to do it.
Getting EFI-Mode Booting to Work
Macs have EFI firmware, so doing native EFI-mode booting is doable; however, Macs are always a bit weird. For most EFI-based computers, the Compatibility Support Module (CSM), which provides BIOS compatibility, is a complication if you want to boot in EFI mode. (See my page on this subject for details.) On Macs, the CSM is activated by the presence of an MBR or hybrid MBR on the hard disk, so you want to be sure this does not exist. GParted and parted
wipe a hybrid MBR if the disk is partitioned as a GPT disk, and gdisk
can wipe a hybrid MBR via the n
option on its experts' menu. Note that GPT is generally the partition table type used with EFI-mode boots. Thus, if the disk uses MBR, you may want to convert it, which gdisk
can do. (Loading the partition table and then saving it back out via the w
command will probably do the job. You might need to create an EFI System Partition (ESP), though.)
Macs can also boot in BIOS/CSM/legacy mode if an optical disc or USB flash drive supports this boot mode. It sounds like this has been happening to you with some of the media you're trying.
One way to help gain control of your boot mode, to enforce an EFI-mode boot, is to use my rEFInd boot manager. Download the USB flash drive version of rEFInd, write it to a USB flash drive, and then edit the EFI/BOOT/refind.conf
file on the disk: Uncomment the scanfor
line and ensure that the three BIOS-mode boot options (hdbios
, biosexternal
, and cd
) are not present on the scanfor
line. When you boot the rEFInd medium, it should show you EFI-mode boot options only. This should enable you to boot another medium in EFI mode -- provided, of course, that this medium supports EFI-mode booting (not all do). Note that rEFInd is sometimes slow to show some boot options. Hitting Esc causes it to scan again for bootable media.
In any event, once you boot to a Linux OS in EFI mode, you should be able to use efibootmgr
to add, delete, and modify EFI boot manager entries. Cory T has outlined how to make a particular entry active, but it's not clear that you've got one for your Linux boot loader -- or even if one is installed. If you don't have a Linux EFI-mode boot loader installed, one way to do so is to install rEFInd to your hard disk. This is best done once you've booted to the target OS itself. (The refind-install
script should work even from an emergency disk, but that code is relatively poorly tested, and it just can't figure out everything it might need to, making a boot to the target OS a safer option.) Another option would be to use Boot Repair -- but as above, I don't know how well it would work with distributions that aren't closely related to Ubuntu. I'm not familiar enough with the distribution you're trying to install to know if it even provides an EFI-mode boot loader. If not, you'll have to install one yourself. See my EFI Boot Loaders for Linux page for suggestions.