FreeBSD, Mac Mini and ZFS

630 9th Ave , Suite 901, New York, NY 10036
Phone: +1 646-215-2200
Fax: 917.398.9853

An older Mac Mini that may not run the latest version of OS X can make a great workgroup or lab server when loaded with FreeBSD. The procedure is not straight forward due to the way Apple implemented their UEFI firmware. This article will explain how I turned a discarded Mac Mini into a private cloud server using FreeBSD, ZFS, Jails, vnet(9). The first installment details the base system install.

Introduction:

Previous installations of FreeBSD on Macintosh G3 and G4 computers have been a complete success, so I had high hopes that the same would be the case with FreeBSD 11 on an older 32 Bit Intel based Mac Mini.

Due to Apple’s desire to make booting alternative operating systems difficult on their Intel hardware getting FreeBSD with ZFS operational was more of a challenge than originally anticipated.

The original goal of FreeBSD 11 with ZFS root on the 32 bit Mac Mini seemed possible based on several guides found on the internet. The reality proved to be very different.

The end result of my efforts are a FreeBSD 11 install with a small UFS root and ZFS for everything else. While the details of why ZFS root did not work may be of interest to some I suspect most readers are here to find out how to install FreeBSD 11 on their own Mac Mini to turn it into a rocking home server or even wireless router, so I will move right to those fun bits.

Please keep in mind this is about a 32bit Mac mini running FreeBSD 11. While I believe all the below will apply to a 64 bit system I have not tried on a 64 bit system.

Required Items:

  • 32 bit Mac Mini
  • bootable copy of Mac OS X on USB a device
    • I used 10.6.8, other versions should work as well
  • cd burner and software to burn a cd 
  • access to the internet
  • web browser
  • ftp client

Software Downloads:

  • visit your nearest FreeBSD mirror site and download the compressed disc1 ISO
    • ftp://ftp5.freebsd.org/pub/FreeBSD/releases/i386/i386/ISO-IMAGES/11.0/FreeBSD-11.0-RELEASE-i386-disc1.iso.xz 
    • This should be done on a system that can burn CDs
  • On your Mac Mini running OS-X visit http://refit.sourceforge.net/ and download the DMG file.

A tale of two discs:

This procedure requires 2 disks to complete the installation.  At the start you need a bootable Mac OS X 10.6 or later disc. This disc will be used in early stages of the install and again at the last stages of the install.  This can not be the disc where you plan to install FreeBSD 11.  In my case I removed the 80G Mac Mini internal disc, replaced it with a 1TB internal disc and put the 80G disc into a USB case to use it as a bootable USB drive.  You could also prepare a USB flash drive with a working copy of OS X, but that is beyond the scope of this article.  

Stage 1:

  • unxz (uncompress) the FreeBSD 11 install disc ISO downloaded above.
  • Burn the FreeBSD 11 disc-1 ISO to a CDROM.
  • Set this CDROM aside for later use.

Stage 2:

  • Install REFIT boot manager on your working Mac OS X boot disk according to the instructions at http://refit.sourceforge.net/doc/c1s1_install.html
  • activate REFIT per the above instructions
  • Reboot your Mac Mini.  You should see the REFIT boot screen and a choice to boot Mac OS X.
  • Once the Mac Mini is booted you can shut it back down and disconnect the Mac OS X disc and set it aside.  It will be needed later.

Stage 3:

  • With your target disc for the FreeBSD 11 installation installed in the Mac Mini power it up.  
  • Insert the FreeBSD Install CD into the Mac Mini and reboot.
    • You should see the FreeBSD Install screen.
  • When presented with the welcome screen chose <Shell>
  • At the shell prompt (#) type dmesg | less<enter>
    • page through the output and assure yourself that the system has recognized all the important hardware.  In my case the disc, wireless, ethernet, sound, mouse, keyboard, video, crypto, and usb were all discovered by the generic kernel on the FreeBSD 11 install disc.
  • If you see indications that all your hardware is recognized we are ready to exit the shell and proceed.  
    • If critical hardware does not appear in the output of dmesg shutdown the system and investigate the possible hardware issues.
  • At the Welcome Menu select Install.
  • On the next screen select your preferred keymap or accept the default (US PC).
  • Select a hostname for your system on the next screen.
  • On the next screen make sure no optional distributions are selected.  We will add optional selections after the base install is finished and we have our ZFS file systems built.
  • On Partitioning Screen select Manual.
    • Have no fears about the warning about this being an expert option.  I will walk you through it.
    • Create one BSD partition which is all but 32 GB of your disk.
    • Create one apple-hfs partition which is 32GB
    • subdivide the BSD partition into 1G root and 2xReal-Memory for swap. 
    • set the remainder as freebsd-zfs

freebsd-mac-img