Dual-Booting OS X or macOS with Linux without rEFInd
Ubuntu installs grub and other files in the first EFI System partition on a Mac computer. Normally, this is the first partition on a Mac computer. The process of making the Ubuntu appear on the Startup Manager is a fairly trivial. The steps are given below.
Note: Starting with Ubuntu 18, the installer software should automatically create the files necessary to boot Ubuntu on a Mac. Therefore, Ubuntu 18 and later users should be able to skip steps 5 and 6.
Install Ubuntu.
When finished, restart and hold down the option key to invoke the Startup Manager. Select to boot from the OS X (or MacOS) volume.
Open a Terminal application window.
Mount the EFI System partition by entering the command given below.
diskutil mount disk0s1
Create a folder named
Boot
in the folder/Volumes/EFI/EFI
. You can use the Finder application or enter the command given below.mkdir /Volumes/EFI/EFI/Boot
Copy the file
grubx64.efi
from the folder/Volumes/EFI/EFI/ubuntu
to the folder/Volumes/EFI/EFI/Boot
. Next, rename this filebootx64.efi
. This step can be accomplished by using the the Finder application or by entering the command given below.cp /Volumes/EFI/EFI/ubuntu/grubx64.efi /Volumes/EFI/EFI/Boot/bootx64.efi
(Optional) Download a collection of icons from the sourceforge web site Mac icns. Use the Finder application to open the downloaded file
mac-icns.dmg
, then enter the command below to copy the Ubuntu icon fileos_ubuntu.icns
to the EFI System partition.cp /Volumes/mac-icns/OSX10.11.6/os_ubuntu.icns /Volumes/EFI/.VolumeIcon.icns
This will add the following Ubuntu icon to the Startup Menu.
Note: When finished, you can use the Finder application to eject the
mac-icns
volume.Use the Finder application or enter the command below to unmount the EFI System partition labeled
EFI
.diskutil unmount disk0s1
Be aware that neither rEFIt nor rEFInd damages, much less "wipes out," the default Apple boot loader; indeed, both rEFIt and rEFInd simply insert themselves into the boot process and then launch Apple's boot loader themselves.
Fundamentally, rEFIt and rEFInd are boot managers. A boot manager presents a menu or some other user interface tool to enable you to select which OS to boot. Most EFIs, including Apple's, include their own boot managers; however, these built-in boot managers are usually very primitive. On a Mac, you launch the built-in boot manager by holding down the Option (or Alt) key as the computer starts up (when the startup chime sounds). The Mac's built-in boot manager is awkward to access and limited in its capabilities. I presume this is what motivated Christoph Pfisterer to create rEFIt. I forked rEFIt into rEFInd after rEFIt fell into disrepair. I was more motivated by boot issues on UEFI-based PCs, but rEFInd remains a way around the limitations of Apple's boot manager.
A boot loader, by contrast, loads a kernel into memory and transfers control to it. A boot loader does not need to interact with the user directly (although it could). Neither rEFIt nor rEFInd is technically a boot loader, although the Linux kernel creates a blurred line, because it includes a feature (the EFI stub loader) that enables it to function as its own EFI boot loader. Also, some boot loaders, such as the GRUB 2 boot loader that's popular with Linux distributions, function as boot managers as well as being boot loaders.
If you're dual-booting Ubuntu and OS X (or macOS, as it's been recently re-named) on a Mac, it's a practical necessity to add something to the boot process. You could rely on Apple's boot manager to control which OS to boot, and in that case no non-Apple tool would be involved when booting OS X. You'd still need something (GRUB, rEFInd, or some other boot loader or boot manager) to launch a Linux kernel, though. Given that most of these tools are more convenient to use than is Apple's built-in boot manager, most users leave them set in the boot order such that they're called before the OS X boot manager.
If you simply dislike rEFInd, you can certainly do without it. You could rely on GRUB 2's boot manager features, or you could install another tool, like gummiboot/systemd-boot. In theory, if you install Ubuntu in EFI mode, it should install GRUB 2 in a way that will make it the default boot manager, and it should provide options for booting both Ubuntu and OS X. In practice, I'm not sure that will work -- Apple does everything a little differently, and so few enough people do it this way that I can't promise it would work. You could try it, though, and then fix any problems you encounter after the fact. I recommend learning more about EFI booting before you start, though, so that you don't make some basic mistake like booting the installer in BIOS mode or setting up your partitions in the wrong way. You might start with these pages:
- Adam Williamson's blog entry on how EFI works -- This page describes the theory behind EFI-mode booting.
- A question and answers on the differences between BIOS and EFI booting on Superuser.com -- This provides the basics of the preceding, but is more concise.
- My page on installing Linux on EFI systems -- This page is a more practical introduction to EFI-mode booting than Adam Williamson's blog.
- My page on the CSM -- This page covers the CSM, including when it's useful and when it's not. It's somewhat PC-centric, but most of the information applies to Macs.
- The Ubuntu community wiki entry on UEFI -- This page is a bit disjointed, but is the most Ubuntu-specific introduction to EFI and its issues.
If you decide to stick with the more traveled path of using rEFInd, be sure to check the date of any instructions you follow. Some very old pages are still out there, and they usually fail to address new issues like System Integrity Protection (SIP); or they describe using the abandoned rEFIt rather than the newer rEFInd. (Although rEFIt can still be made to work with newer OS X versions, doing so may require jumping through undocumented hoops.)