Installing Linux Mint 21 on a Late 2013 iMac with Fusion Drive

I’ve had my old Late 2013 27″ iMac sitting in its box in our back room ever since I bought my Apple Silicon MacBook Pro at the end of 2021, I did some cleaning and tidying the other weekend and ended having enough space to be able to set the iMac up on the desk with a keyboard and mouse. While it’s not a retina-quality screen, it is a quite nice display, and there have been a few occasions when I’ve been doing something out in the back room and wanted to look something up but it was awkward doing it on my phone.

Once I set the iMac up I turned it on, it still works fine but the latest OS it can run is Mac OS X 10.15 Catalina which is ooold. The latest Firefox still works on it, but the rest of the OS would be a Swiss cheese of security holes so I figured I would do what I do to basically all my old Macs at some point or another and install Linux on it. 😛

I remember trying to install Linux on this machine a few years ago and having zero luck at even booting it, though I mostly just gave up and went and did something else at that point, there wasn’t much troubleshooting actually done! As with my previous adventures installing it on my old MacBook Air, I went with Linux Mint because I’ve found it to be the easiest to use and has wide hardware support.

During my research I found this repository on GitHub which claims to be a guide but doesn’t actually have any guides to follow, just a selection of software versions of various things. Even so, it was quite helpful because it seems that anything that uses kernel version newer than 5.x will have problems on the iMac’s specific hardware, and the latest Linux Mint 22 uses the 6.x line. Linux Mint 21 still uses the 5.x kernel, so I grabbed the latest as of writing 21.3 Cinnamon Edition from their main downloads page and imaged it onto a portable SSD using Raspberry Pi Imager (even though the iMac has an SD card slot, you can’t boot from an SD card sadly).

Step 1: Splitting the Fusion Drive

My model of iMac was one that has Apple’s “Fusion Drive”, which is marketing speak for a smaller SSD combined with a large hard disk that appears as one single drive to the OS, and where the OS puts the system and applications onto the SSD for fast access. The size of the SSD shrunk in later iMac revisions before they went all-SSD, but the one in the Late 2013 iMac is 128GB which is plenty for just installing Linux onto, and I was going to partition it so I could still have a Mac OS X installation.

The first thing is that the Fusion Drive needs to be split up so it appears as its two separate drives in order to partition them, so boot into Recovery Mode by holding down Cmd-R as soon as you press the power button, then go into the Utilities menu and open Terminal.

Run diskutil apfs list and you’ll see an entry that says something like APFS Container Reference: disk3 (Fusion). That disk number (disk3) is the identifier for the Fusion Drive, so run disktuil apfs deletecontainer disk3 to break the Fusion Drive apart, then you can close the Terminal window and open Disk Utility to format or otherwise partition the drives. I split the SSD into a 75GB partition for Linux Mint and the rest for Mac OS X, and partitioned the hard drive exactly in half, half of which will be used to mount my home folder under Linux Mint, and the other half for use by Mac OS X.

Step 2: Install Linux Mint

At this point it’s pretty straightforwards, reboot and hold down Option to select the “EFI Boot” disk that is the Linux Mint live image on the external SSD and follow the installer steps to format the partitions from Step 1 above, I set the 75GB portion of the SSD to be mounted at / and the half of the hard disk as /home.

Once it’s all installed, it’ll prompt you to reboot.

Step 3: Getting wifi working

Fortunately unlike some distributions (looking at you, Debian) Linux Mint actually includes the wifi drivers that the iMac needs, but because they’re proprietary it doesn’t install them by default. You install them by running the Driver Manager, but if you simply open Driver Manager from the application menu it complains that you’re offline and doesn’t give you any options. It points out that you can also use installation media, but for whatever reason even though the portable SSD was still plugged in, it wasn’t actually mounted so Driver Manager couldn’t see it.

Instead of mucking around with mount commands, you can just open a terminal window and type mintdrivers, which will open the Driver Manager but detect that the installation media is there and offer to mount it for you. Once that’s done you can enable both the NVIDIA drivers and the Broadcom wifi drivers and reboot when prompted, and you’ll be up and running!

Miscellanous odds and ends

Linux’s equivalent of macOS’s Night Shift

I had been using F.lux for many many years to tint my screen orange at night to make it easier on the eyes after dark, and switched to the macOS/iOS native “Night Shift” when that was added a number of years back. F.lux exists for Linux but it hasn’t been updated since 2013 and doesn’t work anymore. Linux Mint 22 has a new thing called Night Light that’s the exact same thing as Night Shift and gives you a nice UI to control everything from, but unfortunately it doesn’t come with Mint 21. There is an older application called Redshift but the automatic sunset/sunrise detection relies on another executable geoclue2 that isn’t being updated either and the Redshift applet installed with Mint doesn’t give you any configuration options. Fortunately you can configure Redshift manually, so create a file ~/.config/redshift.conf and drop the following contents into it:

[redshift]
temp-day=6500
temp-night=3700
gamma=0.8
fade=1
adjustment-method=randr
location-provider=manual

[manual]
lat=-33.8
lon=151.2

You may need to adjust the temp-* values to taste, lower is warmer, and the [manual] section at the bottom contains the latitude and longitude for your current location. fade=1 will mean the colour will change gradually when sunset happens, if it’s set to 0 it’s an immediately switch from day to night mode.

Once that’s created, find Redshift in the application menu and open it and if it’s night time, you’ll see the nice orange-tinted colour!

Changing keyboard shortcuts to match the Mac’s with Toshy

One of my biggest dislikes when using Linux (or Windows for that matter) is that the primary shortcut key is Control. Apart from the muscle memory of my entire life worth of using Macs, using Control as the primary key for shortcuts is ergonomically extremely awkward. Plus you end up with the really stupid situation of copy being Ctrl-C except for if you’re in a terminal session and it’s Ctrl-Shift-C because Ctrl-C interferes with the standard UNIX shortcut for terminating the currently-running process.

A little while back I discovered Toshy, which is a whole package that modifies all the standard Linux keyboard shortcuts to be remapped to use Command instead of Control as the primary shortcut, so it feels exactly like you’re on a Mac and aren’t constantly breaking muscle memory. It works extremely well to the point where as I type this on my Asahi Linux-equipped M1 MacBook Pro, I’m frequently forgetting that I’m even using Linux at all because all my shortcuts are just working completely seamlessly!

Leave a Reply

Your email address will not be published. Required fields are marked *