Solved Mac Mini 3,1 -- Installation of 10.3-Release

Any version of FreeBSD post 9.1-Release (both i386 and amd64) fails to install on my late 2009 Mac Mini hardware version 3,1.

The problem would appear to be the GPT boot partition code that FreeBSD installs. It changed from 64KB to 512KB at some point after 9.1-Release. Up and until after 9.1-Release, the installation recipe I posted worked successfully. Here is an example:

Code:
trev@shadow [/home/trev] $ gpart show
=>  34  976773101  ada0  GPT  (466G)
  34  128  1  freebsd-boot  (64K)
  162  4194304  2  freebsd-ufs  (2.0G)
  4194466  41943040  3  freebsd-ufs  (20G)
  46137506  83886080  4  freebsd-ufs  (40G)
  130023586  83886080  5  freebsd-ufs  (40G)
  213909666  41943040  6  freebsd-ufs  (20G)
  255852706  419430400  7  freebsd-ufs  (200G)
  675283106  281018368  8  freebsd-ufs  (134G)
  956301474  18874368  9  freebsd-swap  (9.0G)
  975175842  1597293  - free -  (780M)

I should note that it is possible to upgrade a 9.1-Release to 10.3-Release from source as this retains the original 64KB GPT boot partition. However, it is no longer possible to install FreeBSD post 9.1-Release on a new Mac Mini using the GPT partitioning scheme. Bummer. I posted more details about this issue here previously.

After much trial and error I have found that it is possible to install FreeBSD 10.3-Release (I installed the non-UEFI, amd64 version) if you forgo the GPT partitioning scheme and instead use the MBR partitioning scheme. Here is the result:

Code:
trev@citadel:~ % gpart show
=>  63  312581745  ada0  MBR  (149G)
  63  312475590  1  freebsd  [active]  (149G)
  312475653  106155  - free -  (52M)

=>  0  312475590  ada0s1  BSD  (149G)
  0  4194304  1  freebsd-ufs  (2.0G)
  4194304  2097152  2  freebsd-swap  (1.0G)
  6291456  20971520  4  freebsd-ufs  (10G)
  27262976  83886080  5  freebsd-ufs  (40G)
  111149056  83886080  6  freebsd-ufs  (40G)
  195035136  20971520  7  freebsd-ufs  (10G)
  216006656  96468933  8  freebsd-ufs  (46G)
  312475589  1  - free -  (512B)

And here is the new recipe for achieving this:
  1. Boot the FreeBSD CD/DVD by turning on the Mac Mini and holding down the ALT/Option key until a Windows CD Icon appears. Choose that icon to boot. Do not use the internal CD/DVD drive for the FreeBSD disc as you will not be able to eject it. I found this out the hard way. Luckily I also had an external DVD drive so I could load the OSX installation and use Diskutil to eject the disk.
  2. When the system has booted to the FreeBSD Installation Menu, choose Install.
  3. Choose your default keymap.
  4. Set your fully qualified hostname.
  5. Select your distribution files.
  6. Select the Guided Disk Setup option.
  7. Select the "entire disk" option.
  8. Change the Partitioning Scheme from the default highlighted GPT to MBR.
  9. Accept the defaults if you don't mind having everything in the root partition, otherwise delete the default setup and create your own mount points and disk sizes.
  10. Proceed with the rest of the installation as normal.
  11. Eject the disc when the installation is completed.
  12. Boot into an OSX installation DVD (I had a Mac Mini Leopard DVD handy), choose the language, then Utilities, then Terminal from the menu at the top of the screen.
  13. In the terminal, enter diskutil list and look for the FreeBSD partition (it will look like /dev/disk0sX)
  14. In the terminal, enter bless -device /dev/disk0sX -setBoot -legacy (where disk0sX is the identifier you found in step 4 above - if you have one internal hard disk it will be disk0s1 in all probability).
  15. Exit from the terminal and Quit the installation process
  16. Reboot and enjoy FreeBSD 10.3!
The only upside to using the MBR partitioning scheme is that FreeBSD boots much more quickly than when previously using the GPT partitioning scheme which had a delay of around 60 seconds before the Mac Mini would find the FreeBSD boot partition.

NOTE: I did not try the UEFI amd64 disc 1 version of 10.3-Release. For completeness I guess I will try it and add a followup. Previous attempts before 10.3 have been unsuccessful in even booting the Mac Mini.
 
Miracles happen :)

The amd64 UEFI disc 1 version of FreeBSD 10.3-Release boots on the Mac Mini (hardware version 3,1 - late 2009) and the installation proceeds normally with the defaults.

If the OSX DVD is in the DVD drive, then the system boots from the hard disk, otherwise it's just a flashing cursor in the top left of the black screen that appears after the white screen. To solve this issue, you simply need to bless the EFI boot partition. So:

1. Boot into an OSX installation DVD (I had a Mac Mini Leopard DVD handy), choose the language, then Utilities, then Terminal from the menu at the top of the screen.
2. In the terminal, enter diskutil list and look for the FreeBSD EFI partition (it will look like /dev/disk0sX)
3. In the terminal, enter bless -device /dev/disk0sX (where disk0sX is the identifier you found in step 2 above - if you have one internal hard disk it will be disk0s1 in all probability).
4. Exit from the terminal and Quit the installation process.
5. Reboot and enjoy FreeBSD 10.3!

Booting this installation takes 30 seconds or so from a cold start, but is instant from a warm start.

Code:
trev@citadel:~ % gpart show
=>  34  312581741  ada0  GPT  (149G)
  34  1600  1  efi  (800K)
  1634  304085440  2  freebsd-ufs  (145G)
  304087074  8388608  3  freebsd-swap  (4.0G)
  312475682  106093  - free -  (52M)
 
Alas, the miracle that was UEFI went bad :(

Disk access, especially while compiling ports, resulted in frequent panics (trap 12s).

I went back and installed the non-UEFI version of FreeBSD 10.3-Release and all has been well. Around 500 ports have been installed over two days without a single panic :)
 
There is no such thing as "UEFI disk access". After boot everything runs the same regardless of the booting method so I can't see how that would have an effect on stability. The only thing that comes to my mind is the console screen mode that is handled differently when booting with UEFI.
 
I didn't suggest there was such a thing as "UEFI disk access", I simply reported the panics I observed which coincided with heavy disk access while using the UEFI version.

I checked both the memory and the disk without any issues being found before re-installing the non-UEFI version which has been panic free for three days now. Beats me.
 
Just a followup on the issue of a FreeBSD 10.x 512KB GPT boot partition not booting on the Mac Mini 3,1 (late 2009)
o the 64KB GPT boot partition from FreeBSD 9.x does boot
o a 128KB GPT boot handcrafted partition for FreeBSD 10.x does boot

Additionally, there was no need to use the OS X bless utility on a new hard disk. Instead, I added the "bootme" attribute with FreeBSD 10.3s gpart(). The Mac Mini ignored the degrading internal FreeBSD 10.3 hard disk installation and booted from the new FreeBSD 10.3 installation on the USB-attached hard disk as desired (after approx 60 seconds). Magic!
 
Back
Top