Friday, June 21, 2013

Resizing DIY Fusion Drive With CoreStorage

As many of you have seen on my other post, I have my own DIY "fusion drive" in my 2011 MacBook Pro that already runs Windows 8. However, I've decided to triple boot my system with an Arch Linux installation. For most users, this can be easily accomplished through Disk Utility, where the OS X partition can be resized in a non-destructive manner. Unfortunately, when CoreStorage volumes are created, this cannot be done. After some research into more of the verbs for diskutil, I came across some undocumented CoreStorage commands that let me do so.



The steps are relatively simple, although it can be a time consuming process. It took about 25 minutes for me to do. The basic steps are as follows:

  • Identify the CoreStorage logical and physical volumes you wish to alter. 
  • Resize the logical volume size (AKA your Fusion Drive)
  • Resize the physical volume size (The CoreStorage Partition on the physical hard drive)
DISCLAIMER: While this did work flawless for me twice, there is always a responsibility for something to go wrong, even if you follow the directions below exactly. I am not responsible for any data loss or damage to any of your property. Play it smart and back up your system before attempting this.

To begin, I am using a program called iPartition to view the sizes of the partitions on my hard drive. This isn't the most up to date program, but for users who haven't utilized CoreStorage volumes, it is an extremely excellent partitioning program, and can even do advanced things like allowing you to shrink your Mac OS X partition and expand your Bootcamp partition non-destructively, which is impossible in Disk Utility. (Note: I am not affiliated in any way with Coriolis Systems, but I know a good piece of software when I see one.) As you can see in the image below, I have done this once to free up 3.84 GB of space. The rest is split between "Fusion Drive" and "BOOTCAMP." Notice how there are no partitions for EFI or anything else. Those supporting partitions are all CoreStorage volumes and within the logical volume of Fusion Drive.



Now, let's open up terminal and type diskutil corestorage list
It is important to note the difference between Physical volumes and Logical Volumes. In the title of each one, you see the UUID. This UUID will be unique for every single installation, so in the future commands listed here, replace mine with your corresponding UUID.



For the first command, we will be shrinking the 733 GB Logical Volume by 8 GB. To do so, I will be using the command diskutil corestorage resizeVolume 73DE2A72-4AA6-4F4F-A6BC-C6065D6D8113 725g where 725g is the new size I want the volume to be.
This command takes about 2 minutes to complete and your computer may become completely unresponsive during this process. Do not panic.

The second command will be used to shrink the 615 GB Physical CoreStorage volume on the hard drive by 8 GB. This will be done with the following command: diskutil corestorage resizeDisk FF52D05C-167B-403A-9C6D-110D02E444C3 607g
This command takes much longer(10 minutes or so for me) to do and will look frozen at 10% and 50%. Again, do not panic, and let it run its course.

That's it! Now if we check back in iPartition, you will see the free space is much larger than before! This space can be used for a Linux installation, a second Windows installation, or even an encrypted storage volume for sensitive data.