Refind Boot Manager For Mac



The rEFInd Boot Manager: Installing rEFInd. Smith, rodsmith@rodsbooks.com. Originally written: 3/14/2012; last Web page update: 3/13/2020, referencing rEFInd 0.12.0. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. 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. Configuring rEFInd boot manager as your startup disk on a Mac. So I’ve installed Ubuntu on the metal of my MacBook Pro Retina (13 inch, if you must know) and in order to dual-boot the machine, I use the rEFInd Boot Manager. It works really well and was simple to configure, but I found that after upgrading to Yosemite (10.10), Mac OS X became the default boot OS, whereas rEFInd. REFIt is a boot menu and maintenance toolkit for EFI-based machines like the Intel Macs. You can use it to boot multiple operating systems easily, including triple-boot setups with Boot Camp. You can use it to boot multiple operating systems easily, including triple-boot setups with Boot Camp. REFInd is a custom boot manager for Mac which allows us to boot different OSes which is not possible with the default boot manager for Mac. However, installing rEFInd won’t harm your Mac in any way, it’s pretty safe and you can remove it anytime you want and you will get your old default boot manager.

Refind Boot Manager For Mac

In this blog post I’ll be covering the process of installing and troubleshooting refind bootloader from a machine running Windows 10 1903 (although I hope this will survive any updates from Microsoft).

At first, I tried following the official documentation and replacing the {bootmgr}’s path with refind’s, but it didn’t work. Then, I used BCDEDIT.exe to modify every single path to bootmgfw.efi I cound find but to no effect. After every reboot, Windows kept showing up no matter what.

So, I’ll be describing here the steps I had to take in order to make everything work as expected, and some guide to troubleshoot any error that you stumble on. Here’s a screenshot of the final result:

What our goals are

  • Install and theme refind from a Windows 10 machine
  • Make refind the default bootloader
  • Prevent Windows from setting itself as the bootloader after every boot

What our goals aren’t

  • Cover the details of installing refind from any other Operating System (if you’re not on Windows 10 and wants to install refind, take a look here)
  • Make Secure Boot happy (I may or may not make a blog post about this in the future. If you want to use Secure Boot - which I recommend -, you can start by taking a look at the official documentation on this topic)

What you’ll need

  • refind (duh)
  • Explorer++ or some other file explorer that can be launched as Administrator (I’ll assume that you have one, but it is not required at all. If you feel confortable, you can do all the file moving/editing from your command prompt)
  • A Windows 10 bootable USB stick (or DVD if you live in a cave)¹

¹NOTE: The Windows 10 bootable is not required, but is recommended in case you mess things up.

Before we get started

⚠️ UPDATE: Before you proceed, I recommend trying the steps on the official documentation and using this only as last resort. If you do have to follow this path, I recommend you backup your refind installation folder after the installation is complete. When you are installing some OSes (e.g. Linux), they will overwrite refind’s files and prevent you from booting into refind (but booting into the fresh installed OS will work). If this happens, all you have to do is login into the OS you just installed and restore your refind backup.

Download refind boot manager

First of all, go ahead and disable UEFI’s Secure Boot. I won’t go into details on how to do it, since it changes from system to system. If you don’t know how to do it just search around. Pay attention not to disable UEFI, just Secure Boot.

Getting started

In ordet to get started, we’ll need access to the Windows’ FAT32 EFI partition. To do that, we’ll have to mount it. From an elevated command prompt, issue the following command (where B: is the letter you want to assign to the partition):

After this, you should have your partition mounted at B: (or whatever letter you specified). In order to access it, you’ll have to launch Explorer++ as Administrator (see the note below). If you open it up you should see the following structure:

NOTE: The old trick of killing explorer.exe and launching it from an elevated command prompt doesn’t seem to be working anymore. The B: drive shows up but is not accessible. I prefer not to mess around with this drive’s permissions, so I’m using this alternative method.

Microsoft Windows’ Boot Environment

Microsoft’s folder intuitively contains files used to boot Windows. I’ll summarize what I think is important about the boot process, but if you want to know more, I suggest you start here (this link is where I’m getting all the info below).

NOTE: I’m not an expert, so I may say something that is not 100% accurate. If you find something that you think is incorrect, please drop me a line.

With just Windows installed, this is what the boot flow looks like:

  • UEFI Firmware: Performs CPU and Chipset initialization, load drivers, etc.

  • UEFI Boot Manager: Loads UEFI device drivers and loads boot application

  • Windows Boot Manager (EFIMicrosoftBootbootmgfw.efi): Is responsible for loading the Windows Loader (C:WindowsSystem32winload.efi) chosen by the user (in case there’s more than one Windows installed).

Replacing Windows Boot Manager

Our goal here is to replace Windows Boot Manager with refind (but, of course, allowing refind to call the Windows Boot Manager later if that’s what the user wants).

In order to do that, we’ll use the EFI fallback file. Here’s a quick definition, but if you want to know more, take a look here and here.

The firmware will look through each EFI system partition on the disk in the order they exist on the disk. Within the ESP, it will look for a file with a specific name and location. On an x86-64 PC, it will look for the file EFIBOOTBOOTx64.EFI.

So… let’s recap: we know that the firmware looks for Windows Boot Manager on EFIMicrosoftBootbootmgfw.efi and we know that, if it doesn’t find it, it’ll look for whatever file is at EFIBootbootx64.efi. Hmm…

You probably realized where we are going here, but in case you dind’t: our plan is to set refind as the EFI fallback file and move Windows Boot Loader to some place where the firmware can’t find it. Then, we can create an entry in refind pointing to the place where we moved Windows’ files.

This is actually quite simple, but will require a few hacks. Lets begin.

Installing refind

First of all, rename the existing EFIBoot folder to something like EFIBoot.old, so that you have a backup in case you need it. With this out of the way, create a new EFIBoot folder and copy refind’s files there. Rename refind_x64.efi to bootx64.efi.

One more thing, add the following entry to your refind.conf file (this is important, trust me), replacing {folder} to anything BUTMicrosoft (I’ll use _Microsoft) and {pathtoyouricon.png} with the actual path of your icon:

After this step, refind is properly set up as the EFI fallback. All we have to do now is make Windows Boot Loader unfindable by the UEFI firmware.

Renaming the Microsoft folder

This should’n need a dedicated section, but is not as straightforward as it seems. The EFIWindows folder cannot be renamed from Windows (since it is kept in use).

So, you’ll need to get a command prompt at boot. In order to do that I usually use the Windows bootable (just press Shift + F10 on menu), but there are other ways to do it in case you didn’t set up your bootable media.

At the boot command prompt, mount the EFI partition and navigate to the EFI folder:

At this point, if you explore this folder, you should have your Boot folder with refind’s files and Microsoft folder with Windows’ ones. All you have to do is rename the Microsoft folder to the same name you used on your refind’s menuentry.

⚠️Remember to replace {folder} by the exact same thing you used in your refind.conf file.

And that’s it. Close the command prompt and restart your computer. Next time you boot your firmware should not find Windows Boot Manager and fallback to refind. Since we manually added the Windows entry to refind, you should be able to boot into Windows from there.


Troubleshooting

I messed things up and now I can’t boot my computer

Keep calm. This probably happened to me a few dozen times in the process of trying to install refind.

All you have to do is fix your EFI partition. I usually just format the partition and ask Windows to rebuild it, this way you should have a fresh start. Note that this will only work if Windows is the only operating system installed in this partition.

To format and rebuild the partition, boot into your Windows 10 media (I hope you have one), launch a command prompt and execute the following:

This should rebuild your EFI partition and you should be able to boot into Windows now.

Refind shows up without any option (hangs)

This happened to me. In my case it was an issue with the NTFS driver, so all I had to do was remove the ntfs_x64.efi file from the EFIBootdrivers_x64 folder.

NOTE: You don’t need the NTFS driver to boot into Windows, since the EFI partition is using FAT. For more info, take a look here

If it isn’t a drive issue for you, see if any of the below helps. This is a quote from refind’s author Roderick W. Smith:

This sort of problem normally indicates a filesystem issue – rEFInd is getting stuck in an infinite loop attempting to read one of the filesystems on the disk. I recommend you try the following:
1. If you have any external disks attached to the computer, try unplugging them. Such disks sometimes cause problems. If this fixes the problem but you need to use the external disk on a regular basis, you may need to further debug the problem as below; but if it’s just a USB flash drive that you don’t need to leave permanently attached, then this should be the end of it.
2. Remove (or move) all the EFI filesystem drivers from the “drivers”, “drivers_x64”, and “drivers_ia32” subdirectories of the rEFInd installation directory. (Normally there’ll be only one drivers subdirectory; just remove all those driver files.) Reboot. 3. If rEFInd hangs even with no EFI filesystem drivers installed, then the problem is likely with the ESP or some other FAT filesystem. You can try doing a filesystem check on such partition(s) with dosfsck in Linux, CHKDSK in Windows, or similar utilities. In an extreme case, you could try backing up the ESP (and/or other FAT partitions), creating a fresh filesystem, and restoring the data.
4. If rEFInd comes up and shows a menu after removing the filesystem drivers, even if the menu options are incomplete, then this is good; it indicates that there’s a problem with one of the filesystems or their drivers. You can then begin restoring the driver(s) that you need. Normally this will be just one, for whatever filesystem holds your Linux kernels. (You do NOT need the NTFS driver to boot Windows.)
5. If rEFInd works at this point, then you’re done – the problem was in some superfluous driver(s) that you weren’t using. 6. If rEFInd hangs, then you can try booting in some other way and using a filesystem check utility like fsck on the filesystem(s) that can be read with the driver(s) you restored. With any luck this will fix the problem.
7. If the problem persists at this point, you have a number of options:
a) Remove the offending filesystem driver, install GRUB, and use it to boot the Linux kernel. GRUB uses a different filesystem driver and so may not be affected.
b) If you don’t already use one, create a small (~1GiB) partition to use as /boot, using a different filesystem than your main Linux partition. You can then install the EFI driver for the /boot partition, copy the contents of /boot to it, and adjust /etc/fstab to mount this partition at /boot. The ext4fs, Btrfs, and ReiserFS EFI drivers are the fastest ones.
c) Do as in option b, but use FAT, which requires no special driver. This works better with some distributions than others, though. Debian-based distributions often use symbolic links, which aren’t supported on FAT, in /boot, for instance. Some Arch Linux users like to use FAT on /boot (or mount the ESP at /boot), by contrast.
d) Completely wipe and re-install the offending partition(s). It’s possible that the EFI driver is flaking out because of leftover data that wasn’t completely erased when you created the partition. If you opt to do this, I recommend completely zeroing the partition (with “dd if=/dev/zero of=/dev/{wherever}” or something similar) before restoring it.
e) Try a different EFI filesystem driver. The efifs project (http://efi.akeo.ie/) offers a large number of EFI filesystem drivers, and its variant of the rEFInd driver might work better on your system.
There may be some other options and potential causes I’m forgetting.

rEFInd is a boot manager which allows you to boot multiple operating systems from internal or external hard drives. rEFInd automatically detects EFI bootloaders and shows a graphical interface allowing the user to select which operating system they want to start.

These instructions will show you how to use the automatic rEFInd installer or to manually install rEFInd on a computer running macOS.

  1. Install rEFInd with the automatic installer
  2. Install rEFInd with the manual installer


Download the latest version of rEFInd from SourceForge.


System Integrity Protection (SIP) prevents certain folders from being modified even by the root user or by a user with root privileges. Mac OS 10.11 (El Capitan) and later have SIP turned on by default. SIP must be disabled in order to install rEFInd.

Check if System Integrity Protection is enabled:

If it returns System Integrity Protection status: enabled., follow these steps to disable SIP before installing rEFInd:

  1. Restart your computer.
  2. While your computer is restarting hold down Command-R (⌘R). This will start your computer in Recovery mode.
  3. After your computer restarted, click on the Utilities menu and select Terminal.
  4. Enter csrutil disable.
  5. Restart your computer normally.


System Integrity Protection (SIP) protects your computer from malicious software. Re-enable SIP after you finish installing rEFInd. There are instructions to re-enable SIP at the end of the manual and automatic installation instructions.


  1. Uncompress the rEFInd zip file that you downloaded from SourceForge.
  2. Open Terminal and navigate into the uncompressed rEFInd folder.
  3. Then enter:./refind-install

An automatic installer will install rEFInd into your EFI partition.


Re-enable System Integrity Protection

After you finish installing rEFInd, you should re-enable System Integrity Protection (SIP). The process of re-enabling SIP is almost identical todisabling it:

  1. Restart you computer.
  2. While it’s restarting hold down Command-R (⌘R). This will start it in Recovery mode.
  3. Click on the Utilities menu and select Terminal.
  4. Enter csrutil enable.
  5. Restart your computer normally.


That’s it

After restart, your computer will load the rEFInd boot manager automatically. You will see a screen like the one below. Use the left and right arrows to select an operating system.


These instructions will show you how to install rEFInd manually by copying specific files from the rEFInd zip file to a folder on your computer.


Identify Your System

First you need to identify if you have a 32-bit or 64-bit system.

Open Terminal and enter:

Terminal will return either EFI32 or EFI64.


Mount your EFI System Partition.

The EFI System Partition (ESP) contains files that tell your computer which operating system to load while it is starting up.

To modify your computer’s ESP, create an empty folder and then mount the ESP to that folder.

  1. Create a folder in Terminal:
    sudo mkdir Volumes/esp

  2. Mount the ESP to that folder:
    sudo mount -t msdos /dev/disk0s1 Volumes/esp

Refind Boot Manager For Mac

Refind Boot Manager For Mac Shortcut


Move the rEFInd files

Now move the files from the unzipped rEFInd folder to the ESP folder.

  1. Create an empty folder in the ESP folder for the rEFInd files:
    sudo mkdir -p /Volumes/esp/efi/refind

  2. In Terminal, navigate into the unzipped folder you downloaded fromSourceForge and copy the rEFInd files to the new rEFInd folder you justcreated:
    sudo cp -r refind/* /Volumes/esp/efi/refind/

Mac


Remove Unnecessary rEFInd Files

There are several versions of rEFInd that were copied from the unzipped folder to the ESP folder, but you only need the one version that will work with your computer.

This step will show you how to remove the unnecessary versions of rEFInd from/Volumes/esp/efi/refind/.

Apple computers don’t use an ARM CPU, so you can delete this file:

  • refind_aa64.efi

If you have a 64-bit computer, remove this file:

  • refind_ia32.efi

If you have a 32-bit computer, remove this file:

  • refind_x64.efi


Rename rEFInd Config File

If this is your first installation of rEFInd, rename the refind.conf-sample file to refind.conf:

Refind Boot Manager Macbook


Bless rEFInd

The bless command makes a volume bootable. To bless this installation of rEFInd, enter:


Refind Boot Manager Install

Unmount the rEFInd directory

You can restart your computer now and it will automatically unmount the ESP and run rEFInd after it restarts. If you want to unmount the ESP folder before you restart your computer, enter the following command:

or

Refind Boot Manager For Mac Os


Re-enable System Integrity Protection

If you disabled System Integrity Protection (SIP), you should re-enable itafter you’ve finished installing rEFInd. Re-enabling System IntegrityProtection is almost identical to disabling it:

  1. Restart your computer.
  2. While it’s restarting hold down Command-R (⌘R). This will start your computer in Recovery mode.
  3. Click on the Utilities menu and select Terminal.
  4. Enter csrutil enable.
  5. Restart your computer normally.


That’s it

Refind Boot Manager For Mac Mojave

After restarting, your computer will load the rEFInd boot manager automatically. You will see a screen like the one below. Use the left and right arrows to select an operating system.

Refind Mac