I found installing Debian on a Mac Mini very difficult, but it needn’t be. There are many instructions and suggestions around the web, but I couldn’t find all the information in one place, and when things went wrong I could find no help. So, now that I’ve got a working install I thought I’d blog it in the hope to help other avoid the problems I had.
My Mini is a late 2010 model, the Model Identifier is
Mac Mini 4,1
You can find the model identifier of your machine by selecting Apple menu -> About this mac -> More Info. The model identifier is shown in the hardware overview.
I don’t know which models this information will work with, but if you try it with a different model please let me know of your success, or any problems you had so that others may benefit.
My preference is for a net install of Debian. This way I have the most up-to-date security patches and fixes, and my machine should be good to go when I’m finished with the install.
I chose to keep OS X on my machine in a small partition in case I need it for a firmware update at a later date.
There are two major problems with putting Linux on a Mac – an Intel one at least. The first of these is that Macs have no BIOS, what they have instead is EFI. Linux needs a BIOS so that it knows how to interact with the hardware. We get around this with problem with a replacement EFI called rEFIt.
The second major problem is the hardware in these boxes is either new, and therefore not in the regular install kernels, or it is set up to work in some non-standard way.
These problems lead us to need a custom install disk for this hardware, it may be that, in time, install disks become available that overcome these problems. Fortunately someone has already done this work for us, this web-page has a link to custom net install .ISO that can be used to boot the system and perform the net install. It also has the kernel you will need to boot machine after install.
Use Boot Camp Assistant to partition your hard drive. You can find BCA in the Utilities folder within the Applications folder. You can drag the partitions and re-size to however you want, I partitioned mine so that OS X has about 20 gigabytes, which is plenty, and it leaves a round 300 gigabytes for Linux. This machine is now a mail/news/web/samba server on a home network, if you’re installing for a different purpose then you’ll likely need to resize the partitions differently.
I set the new partition type to FAT, it stands out better when it comes to partitioning within the Debian install. When Boot Camp Assistant asks for the Windows disk (why don’t Apple acknowledge that people might want to install Linux?!) quit the program, it’s already done it’s job.
Download and install rEFIt. This is another reason for keeping OS X on the system, the rEFIt files reside in the OS X partition, I haven’t investigated, but there may be other ways to have rEFIt on the sytem without retaining OS X, but this works for me.
Put the CD burned from the .ISO mentioned above (or linked directly here) into the drive and then re-boot. At the sound of the ‘bong’ (what is that sound called?) press and hold the ‘c’ key, this will cause the machine to boot from the CD. From the boot menu choose ‘Advanced options’ and then ‘Expert install’ it is important that you do not choose the regular install as this does not give you the option to install the custom kernel.
Go through the install steps as they are presented to you, take note of which
/dev your ‘/’ partition is on – you’ll need this for when you install the grub or lilo. Any that are skipped are either not important, or you can deal with them post-install.
At some point you’ll be presented with a list of possible kernels that you can install, you must install the one that comes with the .ISO, it’s
linux- image-2.6.35-stlee-mac-mini-i686, this is the one with the drivers for your hardware.
When it comes to installing the initrd/initramfs choose the generic option, the machine specific option did not work on my Mac Mini, I don’t know why, but this had me banging my head against the wall for a long time and I didn’t know why it wouldn’t work. I spent many hours trying to fix it, but to no avail. Just use the generic version, it works and doesn’t cause headaches or drowsiness.
I chose grub (it’s actually grub2) instead of lilo, on a previous install attempt I chose lilo and it didn’t work, whether lilo would have worked had I chosen the correct initrd/initramfs I don’t know. Grub doesn’t tell you where it’s going to install so you have, at that point, choose to manually set the mount point, and enter the device you noted earlier. I don’t know how this will work if you are using a separate /boot partition.
Before completing the install and re-booting you must edit the file
/etc/defaults/grub and change the line
GRUB_CMDLINE_LINUX to include
reboot=p nouveau.modeset=0 after which you need to execute a shell, and chroot into the install environment and run
update-grub. If you forget to do this then you can boot the machine in rescue mode with the install CD, and execute a shell in the install environment and then carry out the above (which is what I had to do). If you don’t do this then part way through boot you will lose your display! The machine will be up, and all services running, it’ll even be waiting for you to login, but you’ll have no display. The reboot argument enables the OS to actually reboot the machine, rather than just halt it waiting for you to manually power-down, it’s the
nouveau.modeset that stops the display disappearing.
You can now eject the disk and reboot, but if you’ve changed the partition table at all (very likely) you’ll need to run/re-run rEFIt to get the new partition table read. To do this start Terminal.app and:
That should be all that is required, a reboot at this time should give you the rEFIt boot screen and an option to boot either OS X or Linux, if you choose Linux you should get a grub boot menu showing your Linux install as the default, a rescue version of your Linux install, OS X 32-bit and OS X 64-bit.
That’s it. There were a couple of things that I didn’t pick up from the wiki.debian.org/MacMiniIntel page that led me to have problems with the install. One was that there is indication that you should use the
expert install method (regular install has always been fine for me in the past). And the other was that I didn’t know to use the
generic initrd/initramfs. If I’d known both of these I’d not have had any trouble at all.
The MacMiniIntel page is a wiki, so I suppose I could edit it, but it’s not written well enough for me to just append the necessary, and as it’s someone else’s project (having created the net install .ISO) I don’t want to tread on any toes. I’ve sent the maintainer an email but had no reply.
I hope this page is found without too much difficulty and helps someone avoid the pitfalls that I experienced. Please comments regarding your experience either way so that I may update the page.