Creating a Fusion Drive for your Mac

I’ve been running a home made Fusion Drive on my MacBook Pro (mid 2012) for a while know, and it’s been rock solid under OS X Mountain Lion. But as a developer, and with access to Mavericks, I’ve been running the latest couple of beta’s on this machine. At first everything ran fine, but since beta 4 the machine started acting up. Sleep/Wake resulted in Kernel Panics, booting with Option made the boot drive appear twice, and the machine runs either at fast SSD speed, or is slow as hell. And did I mention spotlight re-indexing every couple of days, Dropbox thinking I’ve reinstalled it once again, CrashPlan uploading whole systems again? Trust me, upgrading a home-brew Fusion Drive from Mountain Lion to Mavericks is not stable at all.

While reading through the Developer notes, I saw this lovely note appear:

Finally, the notes point out that Fusion Drive volumes created in Developer Preview 3 are incompatible with OS X 10.8.4 or earlier – Apple Insider

Reading between the lines, I think Apple changed something in how they handle or build Fusion Drives with Mavericks. Since the lack of a Recovery Partition on my current installation also made FileVault and Find my Mac do weird things, I decided to start from scratch and rebuild my entire setup.

The result I was going for:

A 1TB Fusion Drive build from a 256GB SSD, and a 750GB HDD build into a DataDoubler.

A working OS X Mavericks Recovery Partition

Both drives visible when booted with Option pressed

FileVault2 enabled (after verifying both partitions are there and working)

Preparations

What you need

An external hard drive with a bootable copy of your current setup running the latest beta release of Mavericks (at the time of writing beta 5). I made mine with Carbon Copy Cloner. Make it, keep it safe.

External Installer

Connect the empty drive or stick to your Mac

Open Carbon Copy Cloner while booted from your current system.

Go to the Disk Center and copy your Mac’s Recovery Partition to the empty drive. Make sure and verify in CCC that you cloned the Mavericks partition and not a Mountain Lion one. If you don’t have a Recovery Partition, you’re in bad luck. The only option is installing a fresh install of Mavericks on the empty external drive and update it to beta 5. which is gonna take a while.

In the end what we need is an up to date Mavericks Recovery Partition on a external non-Fusion Drive. [^ft2]

Creating the Fusion Drive

Creating a Recovery Partition

On our new Fusion Drive we’re going to want a Recovery Partition. Since a Fusion Drive is a CoreStorage volume, it can’t be resized after its creation so we need to make room for the Recovery Partition before we create the CoreStorage volume.

This guide assumes you’ve got your two drives already installed. Go to iFixit if you don’t know how

Option A:
I’m currently running a Fusion Drive.

Reboot your Mac with Option pressed and select the Recovery Partition on the external drive as the drive to boot from.

If you previously had a Fusion Drive installed on your Mac, follow this guide to destroy it. You’ll lose all data on the drive (stating the obvious here).

We now have a Mac with an SSD and a HDD, each as its own separate volume. While still booted from the Recovery Partition, choose Install Mavericks and install it on the HDD. We want the HDD because that’s the biggest drive, and since a Recovery Partition is basically lost storage space that we only need to get some features working, it doesn’t need to be fast. So instead of the SSD we pick the slower hard drive to install Mavericks, and subsequently a Recovery Partition.

Let the installation do its thing, and when you get to the setup screens, shut down the Mac. We now have a functioning Mavericks Recovery Partition on your Mac. [^ft1]

Option B:
I currently don’t have a Fusion Drive and have a Mac with a working Mavericks Recovery Partition on an HDD

You’re in luck, you don’t need to do anything.

Option C:
I currently don’t have a Fusion drive and have a Mac with a working Mavericks Recovery Partition on an SSD

Format the extra HDD in your Mac with Disk Utility as an Journaled HFS+ drive.

While still booted from the Recovery Partition, choose Install Mavericks and install it on the HDD.

Let the installation do its thing, and when you get to the setup screens, shut down the Mac. We now have a functioning Mavericks Recovery Partition on your Mac. [^ft1]

Merging the drives

We now have a Mac with two drives and a working Mavericks Recovery Partition on the HDD. All that’s left is fusing them together.

Creating the Logical Volume Group

In Terminal, type: diskutil list and press enter.

You’ll see a list view of your available drives, named something akin to disk0 and disk1 with their storage capacity mentioned in the middle.

Find your HDD with the Recovery Partition. You’ll notice its divided in a couple of partitions named disk1s1, disk1s2 and so on. Write down the name of the partition that’s about equal to your HDD’s storage capacity. That’s the part of the drive we want for our Fusion Drive. In my case the Recovery Partition was named disk1s3 and the partition I wanted disk1s2.

Now write down the name of your SSD. Since we want to use this drive’s entire capacity, we’re not going to use a partition, but the entire volume instead. In my case my SSD was named disk0. (Notice it lacks the s1 part!)

Still in Terminal, type: diskutil cs create Fusion disk0 disk1s2 and press Enter. You’re now creating one big volume Fusion that fuses the two drives disk0 and disk1s2 together while leaving the other partitions unharmed.

After a few moments you’ll see a message telling you that the system successfully created a Logical Volume with UUID ########-#######-####### (basically a whole lot of letters and numbers).

Select that UUID and copy it to the clipboard.

Formatting the Fusion Drive

We’ve now merged the two parts together, but it’s still invisible for our file system to work with. In order to get data on the drive, we need to format it.

Obviously you replace the #### with the copied UUID from the clipboard.

You’ve now created a Journaled HFS+ partition called Fusion HD with a storage capacity equal to the entirety of both the selected partitions. In my case a 256GB SSD, and a 750GB HDD giving me approx. 1TB of storage minus some overhead for the Recovery Partition, which is about 650MB.

Finishing up

Reboot the Mac and do yet another PRAM zap to clear all caches.

Connect your cloned system and boot from that drive.

Open Carbon Copy Cloner and copy over your previous system to your newly created Fusion Drive. [^ft3]

Once cloned, shut down the Mac, disconnect all external hard drives, and boot the Mac.

You now have a working OS X Mavericks running from a Fusion Drive with a working Recovery Partition!

After you’ve booted your Mac for the first time, you’ll notice you can access the Recovery Partition when booting it with Option pressed. If, and when, you enable FileVault2 you’ll loose the capability of accessing the partition directly. But it’s still there. That is a feature, and not a bug.

I hope Apple creates an officially sanctioned way to make Fusion Drives, and builds into the Recovery Partition. But in the meanwhile, I hope you enjoyed this guide.

And please always: backup, backup, backup. And I’m not responsible for any data loss.

Questions? Remarks? Contact me and I’ll try to answer them with updates to this article.

[^ft1]: I know this is a bit cumbersome, and only cloning the Recovery Partition to the HDD is faster, but this way we get a Recovery Partition that’s create by, and according to Apple’s specs.

[^ft2]: We could use the drive containing a clone of the current system for this. But in order to keep the data safe, and prevent accidentally loss of data by formatting the wrong drive, I think it’s safer to make a clone, put the drive somewhere safe and work with a separate second drive.

[^ft3]: I choose for a CCC copy instead of a copy via Disk Utility to restore my system since CCC copies over data on a file level, vs a block level with Disk Utility. Since CoreStorage used a different way to write down data than a regular drive does, it seemed safer that way.