Install Refind Mac

  

This page describes how to install Debian on an Intel-based Apple Mac Mini. For more information about Debian on the earlier PowerPC-based model, see MacMini.

  1. If you're using Linux or macOS, and if you can't or don't want to use a distribution package file, the easiest way to install rEFInd is to use the refind-installscript.
  2. First install at a minimum the refindx64.efi and refind.conf files to the /EFI/refind/ directory on the ESP, plus any icon files that you fancy. Then copy refindx64.efi and rename it as bootx64.efi in the /EFI/boot/ directory on the ESP. This bootx64.efi will boot by default, or is supposed to do so in a standard UEFI environment.
  3. If you lower the security, then you can install and boot with or without using rEFInd. Installing Ubuntu to the internal drive of the newest Macs may not yet be possible. With rEFInd, the following happens: The firmware boots rEFInd. The user chooses Ubuntu from the rEFInd menu. REFInd instructs the firmware to boot Grub.

前書き 知り合いにmacでデュアルブートする方法を教えてくれと言われて書いたものです。せっかくなので記事にしました。 手順1:rEFInd のダウンロード rEFInd をダウンロードし、任意のディレクトリに配置します。.

Contents

  1. Installing Debian on a Mac Mini
    1. Installing Debian - the simple way
    2. Older / obsolete information

Install Refind On Mac

Check and update firmware

Verify that your computer has the latest firmware: http://support.apple.com/kb/HT1237 . This is important - some older versions of firmware won't provide some of the underlying support that you'll likely need to install Debian.

Recent firmware adds a BIOS compatibility mode, including detection of BIOS-bootable disks and CDs in the built-in boot volume chooser. In addition, if you want good graphics support in Linux, you must boot it using the BIOS compatibility mode. This is because the X.org / XFree86 drivers for Intel and ATI, as well as the Linux text console, rely on the Video BIOS and Apple's firmware only provides a Video BIOS when booting in BIOS compatibility mode. Without it, you only get unaccelerated frame buffer graphics. Booting in the BIOS compatibility mode also means using either the LILO or GRUB bootloaders, and having an MBR partition table (either hybrid GPT/MBR or plain MBR).

In consideration of all of the above, updating the computer's firmware is the simplest way to easily install and boot Linux and also get 2D/3D graphics acceleration. To enter the builtin boot menu, hold the 'Option' key while booting. This gives the option of installing rEFIt (or other EFI bootloaders?) on a USB key. You must use OS X's 'bless' utility to change NVRAM entries allowing this to boot. It's also possible to boot wheezy installers from a USB key in this manner.

Installing Debian - the simple way

Recent versions of Debian (at least from 8/Jessie onwards) should install and work reasonably well on most Mac Minis without needing any other software to help with setup, assuming that you only want to be able to boot Debian. However, if you do want to dual- or triple-boot with other OSes (e.g. Mac OS X) then you'll be more at the mercy of the other operating systems. See below for more detailed instructions.

The best way to start the Debian installer varies a lot, depending on the age of your hardware.

Macmini 1,1

The oldest Mini (macmini1,1) is typically the most problematic, due to bugs in its firmware. When booting off CD/DVD, if there is more than one El Torito boot record on the disc then the firmware gets confused. It tried to offer a choice of the boot options, but it locks up instead. Unfortunately, all of the normal Debian installer options for both i386 and amd64 now include 2 El Torito boot records (one for BIOS boot, and one for EFI boot). Specifically as a workaround for this broken firmware, there is now a new flavour of i386 netinst image. Look for debian-mac-XXX-netinst.iso. This image should boot and install happily on a macmini1,1, giving you a normal Debian installation when it's finished, booting in BIOS mode using GRUB. There's quite a delay before the GRUB menu comes up (~30s or so) - be patient!

(Tested on a macmini1,1: Intel Core Duo 1.66 GHz, 1GB RAM, using the jessie-DI-rc3 mac netinst for i386. Exact machine description at http://www.everymac.com/ultimate-mac-lookup/?search_keywords=ym6465s2w0a)

If you change the disk by an SSD, you might want to switch the SATA Controller to AHCI mode by adding the following Code to /etc/grub.d/01_setpci_ahci:

This is necessary to enable trim support on the disk.

Macmini 2,1

This revision is nearly identical to Macmini 1,1; but is factory-equipped with 64-bit capable CPU and a slightly different firmware from Macmini 1,1. There were no firmware updates from Apple for this model, so no updates are necessary. This machine will experience the same hangup as the Macmini1,1 when attempting to boot the standard i386 and amd64 install images. The same image as used above will successfully in the Macmini2,1; but there is now a new flavour of amd64 image that will successfully boot and happily install on this system. Look for debian-mac-XXX-amd64-netinst.iso Also like the Macmini1,1; there will be an approximate 30 second delay before booting via BIOS emulation, for both booting from the CD and from the installed system thereafter.

(Tested on a macmini2,1: Intel Core 2 Duo 2.0 GHz, 4GB RAM, using debian-mac-8.4.1-amd64-netinst.iso at http://cdimage.debian.org/cdimage/.jessie-test/amd64/iso-cd/. Exact machine description at http://www.everymac.com/ultimate-mac-lookup/?search_keywords=Macmini2,1

Macmini 3,1

Using any normal amd64 image written to CD/DVD, this machine will boot into BIOS mode and install Debian easily. You must boot from CD/DVD to boot into BIOS Compatibility mode; booting from USB causes the 3,1 to boot into EFI mode. Debian installs fine in EFI mode, but freezes on boot when the nouveauFB driver tries to load due to the lack of a video BIOS. Nouveau is a 'known issue', alternatively install nvidia or other driver and blacklist nouveau.

Once installed, there's quite a delay before the GRUB menu comes up (~30s or so) - be patient!

(Tested on a macmini3,1: Intel Core 2 Duo 2.0GHz, 1GB RAM, using the jessie-DI-rc3 netinst for amd64. Exact machine description at http://www.everymac.com/ultimate-mac-lookup/?search_keywords=ym9035my19x.

Macmini 4,1

Using an amd64 image, this machine will boot and install Debian easily. Oddly, it boots differently depending on the boot media. If using a CD, it boots in BIOS mode (and will then install correctly and boot that way). If booted from a USB stick, it boots in EFI mode and will also install correctly and boot that way.

(Tested on a macmini4,1: Intel Core 2 Duo 2.4GHz (P8600), 2GB RAM, using the jessie-DI-rc3 netinst for amd64 in each case. Exact machine description at http://www.everymac.com/ultimate-mac-lookup/?search_keywords=c07cvl01dd6h.

The Nouveau video driver doesn't support HDMI audio with the ?GeForce 320M video chipset. If you need HDMI audio, you'll have to install nvidia-legacy-340xx-driver and do without Wayland support.

(Tested on a macmini4,1 with Buster 10.5 for amd64)

Macmini 5,3

This machine has no CD drive, so just use the amd64 image on a USB stick again. If booted from the USB stick, it will boot in EFI mode and will install correctly and boot that way.

(Tested on a macmini5,3: Intel Core i7 2.0 GHz (I7-2635QM), 8GB RAM using the jessie-DI-rc3 netinst for amd64 again. Exact machine description at [[http://www.everymac.com/ultimate-mac-lookup/?search_keywords=c07g39r7djy7]].

Macmini 6,1

This machine also has no CD drive, so just use the amd64 image on a USB stick. Note that Debian wags its finger at you if you used unetbootin to make the bootable usb stick. When booting from the USB (hold down Option during BIOS bootup), it will boot in EFI mode. You have the option to do a 'taste test' on your mac mini using Debian live preview or do a full Debian Install.

On Full Install, Debian installer will alert you that your Wifi card is not supported because you need non-free firmware, and it will give you the option of inserting yet another USB stick containing the following file or files: b43/ucode29_mimo.fw b43-open/ucode29_mimo.fw

Otherwise, you can install the Broadcom wifi drivers after the rest of the Buster install is complete. Instructions for performing the Broadcom Wifi card installation after the fact are on the Debian wl page: wl

SW and HW details: Image: debian-live-10.3.0-amd64-gnome.iso HW: Tested on a 2012 mac mini 6,1 Intel Dual Core i5 2.5 GHz, 16GB RAM, Broadcom 4331 Wifi card. Single-boot on 480 GB Solid-State HDD. Exact machine description at https://everymac.com/systems/apple/mac_mini/specs/mac-mini-core-i5-2.5-late-2012-specs.html.

Dual/Triple Boot

If you're not planning to dual boot OS X and Debian (or triple boot OS X, Debian and Windows), you can skip this section - use the simple instructions above.

Otherwise, Mac OS X 10.4.6 and later have online resizing of HFS+ volumes and support for hybrid GPT/MBR partition tables in Disk Utility. To boot multiple operating systems, use OS X's tools to split up your drive and make room for everything. Remember that booting in the BIOS compatibility mode means having an MBR partition table (either hybrid GPT/MBR or plain MBR) so be sure to make the needed changes to your hard drive before continuing. Remember to select the GRUB bootloader from within the Debian installer so that you can access the BIOS compatibility mode described above.

If you make changes using any of the Linux partitioning tools (even just the type of a partition) and are using GPT you need to reboot and use gptsync or 'Partition Tool' from rEFIt to resync GPT/MBR tables and then re-run the installer. If you forget to do this, installing the boot loader will fail.

For dual or triple boot situations, hold down the Option key on your keyboard and the built-in boot volume chooser will let you select what you'd like to boot from.

Older / obsolete information

Firmware and elilo

If you are unwilling or unable to update the machine's firmware, elilo (the EFI Linux Loader) can be used to boot the Mac mini. However, this requires a specially prepared kernel and has some drawbacks (like not having 2D/3D accelerated graphics.) James McKenzie published a hack to elilo that activates the Video BIOS without activating the full BIOS compatibility mode. This actually allows the accelerated drivers to work without booting through LILO/GRUB. Unfortunately it hasn't been updated in months.

Installing with rEFIt or rEFInd

Tested on Mac Mini 3.1 2009 OS X 10.8.2

Install rEFIt or rEFInd (a more recently-updated fork). This will be removed but is needed briefly, later. (Note that you can install rEFIt on a USB stick and boot from that, which is especially useful if your goal is to have just Debian on the system as it simplifies partitioning).

Open Disk Utility and add Debian Partition with Format MS-DOS(FAT) then,

Bless this partition:

$ sudo bless -mount /Volumes/DEBIANHD -setBoot

Download your chosen .iso

convert .iso to .img

$ hdiutil convert -format UDRW -o ./debian-xxx.img ./debian-xxx.iso

then

$ diskutil list

note Debian partition identifier ie disk0s4

unmount Debian partition

Pro

$ diskutil unmountDisk /dev/disk0s4

copy img to Debian partition

$ sudo dd if=debian-xxx.img of=/dev/disk0s4 bs=1m

reboot and now use Refit to select and install Debian.

Install Grub on Debian partition /dev/disk0s4 not MBR see installation guide.

reboot and use refit 'Partition Tool' to resync GPT/MBR tables

reboot into OS X and remove Refit

reboot holding alt key to boot into Grub

a very similiar process can be used to create a bootable USB: Insert USB and Partition Disk, not Volume using the Option: GUID Partition Scheme.

Bless USB $ sudo bless -mount /Volumes/DEBUSBGUID -setBoot

unmount USB $ diskutil unmountDisk /dev/disk1

copy img to USB $ sudo dd if=debian-xxx.img of=/dev/disk1 bs=1m

Known Issues

On the Mac mini (late 2006 model) with Debian 4.0r3 I was unable to get the full 1920 x 1200 resolution on my Apple Cinema HD Display (23'.) I was able to resolve it by using the 915resolution package. Debian 4.0r4 is expected to make updated software available, so the 915resolution package may longer be necessary at that point.

With the mid-2009 (macmini 3,1) model, you need a 'testing' installer to get a recent enough kernel for reboot to work (with kernels from lenny and prior a hard power-off is needed after shutdown).

Sound

The chipset of Macmini1,1 is STAC9220/STAC9921. With Lenny (only), I notice white noise/whitle on the right channel. The following seems to fix it for me :

Keep in mind to remove this line when you will upgrade to Squeeze.

mid-2010 model Mac Mini

There is a very good step-by-step guide here. Use regular install disks.

Helpful kernel flags:

macmini2,1 installation specials and pain

I found that none of the methods mentioned above or elsewhere would allow me to boot my installation media on my macmini2,1 Intel core due 1.8GHz. My machine has a broken internal CD drive so I have attached an external firewire connected DVD burner. This works perfectly for normal use and the rEFInd appears to recognise boot disks in it. however, when the disk is selected at boot time 'boot legacy OS from entire disk' I would get a black screen with 'no boot device found' (or something similar). Same with USB drives created from ISO or DMG (as described above).

Eventually I made some progress by using the step given above to convert a debian netinst 8.3.0 ISO into DMG and copy with DD to a whole USB drive AND burned same to a DVD. I installed rEFInd with the default refine-install script. If I booted and selected the CD or the USB drive legacy OS option it failed with errors about how MAC EFI did not properly support booting from external drives. So I powered off and on again. I then booted the machine and selected the USB drive fallback boot option.

Oddly this appeared to boot but then started using the DVD as well to read some files. I suspect the boot sequence gets confused about which devices it needs to read from, and having the same image in two places satisfied it.

The debian install is now progressing. Hooray!

  • CategoryMacintoshComputer

CategoryMacintoshComputer

I recently decided to run Kali Linux on my MacBook. I originally thought I'd just build it into a Virtual Machine (using Parallels), but was concerned that I might not have the control over the hardware that I'd need in order to make Kali effective as a learning environment. So, I set about working on a dual-boot scenario. Needless to say, I failed miserably when I opted to have Kali install Grub and it overwrote my primary Boot Manager on the Mac and rendered the system unbootable (and eventually unrecoverable). Thank goodness for good backups...

WARNING: Do not proceed with any of these steps unless you have the ability to restore a bare-metal backup. Everything I'm doing has the potential to trash all of the data on your computer, requiring a clean installation of macOS and subsequent data recovery from backups. I use a combination of Time Machine, CrashPlan, and Arq to back up my system, you should too.

Triple Boot the Right Way

If you're interested in triple booting your MacBook Pro, and Windows is going to be one of the Operating Systems you're going to boot, then take my word for it, this is the only way you want to accomplish this feat.

At a high level, the process goes like this:

  1. Install Apple's Bootcamp and use it to install Windows 10
  2. Use Windows 10 to shrink the Bootcamp partition, freeing up space to install Linux
  3. Install Linux (I used Kali) into the newly freed space
  4. Install rEFInd as a Boot Manager for all 3 OSes

To be fair, a lot of my instructions and the guide I initially followed, can be found here. However, several of the steps in that guide I didn't have to use at all, so I'm documenting my process here.

Install Apple's Boot Camp

Apple provides a supported method of installing Windows as a dual-boot option for Macintosh owners. There are several advantages to using Apple's process:

  1. Apple supports this as a way to boot Windows
  2. Apple provides native drivers for the hardware under Windows
  3. You will have supported ways to control the Windows and macOS boot process on your MacBook from within Windows (via the Boot Camp Control Panel)

Install Refind Mac Mini

Apple's official documentation for Boot Camp is found here.

Follow Apple's instructions for installing Windows, but make sure you create the Windows partition approximately 64GB larger than what you want to end up with for Windows, that space will end up being given to Linux. Adjust if you wish, I used a 196GB partition for Windows 10, then split it into 128GB for Windows and 64GB for Linux (FYI, a Windows 10 installation with Office 365 installed takes up 68GB, so give yourself enough room under Windows).

Note: Apple only supports Windows 8.1, or newer, for hardware released after 2014. There is no way to install an earlier version of Windows using Boot Camp on newer hardware. See this table to check your hardware and what versions of Windows are supported on it.

Install Refind Mac Operating System

Now that you have an Apple-supported dual-boot system running macOS and Windows 10 (presumably), it's time to perform the Linux installation.

Create Partition for Linux

For the purposes of this article, I'm going to install Kali Linux, that's what I used, but installation with ANY version of Linux should work the same way.

The first step is to shrink the Windows partition to make some space for Linux:

  1. Boot into Windows 10
  2. Right-click on the Start Menu and select Disk Management
  3. Select the BOOTCAMP partition, right-click and select Shrink Volume
  4. Enter the size, in megabytes, by which to shrink the volume. I shrunk mine by 64GB, so I entered 65,536

This image is AFTER I did my initial shrink and subsequent installation of Kali linux, you'll have fewer partitions when you do this. I also have an SD card mounted.

The shrinking process took a LONG time (~30 minutes), don't worry about it, let it run to completion and do not interrupt.

After the Volume shrinking process is completed, it's time to download some files to perform the installation; however, you probably want to do this under macOS, so first boot back to your macOS volume and the download them both:

  1. Kali Linux, 64-bit, can be downloaded here
  2. rEFInd, can be downloaded here

Place all of the rEFInd files (after unzipping) on a removable volume (SD Card, USB drive, or even a secondary HFS+ volume) so you can use it in the next step.

Install rEFInd

For all macOS versions starting with El Capitan (10.11) Apple has enabled System Integrity Protection (SIP). This security feature of macOS prevents changes to various areas of the Operating System including System-owned files. That means that you cannot install rEFInd directly on drives where SIP is enabled. In order to install rEFInd you will have to boot into Recovery. Make sure the rEFInd files are available on a drive that macOS can see and use, then follow these instructions:

  1. Reboot the computer and hold down Command-R
  2. Once in Recovery mode select Terminal from the Utilities menu
  3. Find the volume where you have rEFInd stored (start with ls /Volumes)
  4. Change into the rEFInd directory and run ./refind-install
  5. You will still get a warning that SIP is enabled, but you can ignore it (SIP is enabled on the boot volume, but you're not installing it there

Full installation instructions can be found on the rEFInd site.

You may also want to theme rEFInd to look more 'mac-like'. I used the OSX Standard Theme 1.0 found here. Upate 20200906: This theme's installation instructions ask you to 'replace the EFI folder' in the rEFInd install you just did, it ALSO replaces the more curent version of rEFInd and the cryptographic keys that were provided. You probably shouldn't do that, though your milage may vary on getting this to work. At the time of this article's original publication, they were both the same version, but now, 3 years later, the theme's version of rEFInd is woefully outdated. Use with caution or update the components in the theme with the newer versions. (thank you Phillip!)

Test that rEFInd is installed and operational. Just reboot and you should be taken to the rEFInd boot menu, from there you should be able to boot into either macOS or Windows 10.

Note: rEFInd will automatically find what it believes to be bootable volumes. They probably all won't be bootable, through trial-and-error you should be able to find the correct macOS and Windows 10 volumes. You can then configure rEFInd to ignore some volumes, but save that for after you have everything working properly.

Install Refind Mac

Install Linux##

Boot into macOS and have a USB key available to be reformatted, it can be pretty small (small works better), an 8GB drive is perfect.

In order to create a bootable USB drive, you can use the Terminal:

Install Refind Mac Pro

  1. Run the Terminal from the Utilities folder under Applications
  2. Change the directory to where you downloaded the ISO for your Linux installation, e.g. kali-linux-2016.1-amd64.iso
  3. Find your USB key by running: diskutil list, note the drive name, e.g. disk2
  4. Run the command: dd -if=kali-linux-2016.1-amd64.iso -of=/dev/disk2 bs=1m
  5. The above command will take a long time to run, as it is imaging the ISO onto the USB drive. Once it finishes you should have a bootable USB key for Kali Linux (or whatever)

Alternatively, if you want a graphical imaging process, you can use UNetbootin as documented here for Ubuntu (just use Kali or whatever image you want).

Install Refind Mac Recovery

You're now ready to install Linux. The reason you had to install rEFInd before installing Linux was that, in my experience, I could not get the standard macOS boot manager to recognize the USB drive I had prepared with Kali Linux. However, if you reboot now, you'll see the rEFInd boot menu. You can then insert your USB drive, then hit ESC to refresh the volumes and you should see the Linux installation drive appear. Select it for booting.

Follow the instructions for installing Linux, making sure to select the correct partition that you created while you were under Windows 10 earlier.

Completed

Install Refind Mac El Capitan

You should now have a triple-booting MacBook Pro. Using rEFInd you can select the appropriate OS and it should boot cleanly on your hardware.

In the event that rEFInd gets clobbered (you'll know, because a power-cycle takes you to the built-in macOS boot manager) you should still be able to boot into Windows, but you'll probably lose the ability to boot into Linux. Just follow the instructions and re-install rEFInd again and it should come back and allow you to boot again.