03/21/2015

Fun with OSX Storage or How to upgrade to a larger boot disk

Tags: Apple MacBook OSX CoreStorage physical volume resizing increase physical volume howto
Recently I bought a larger SSD for my wife's  2011 MacBook Pro and to avoid having to reinstall everything I created an image of the original SSD using my Ubuntu laptop.
I restored the image onto the new drive,  using gParted I then moved the Recovery Partition to the end of the disk to free space directly following the main OSX partition.
This left only one more thing, to resize the actual OSX partition to use the full size of the new drive.

Unfortunately this wasn't so easy as I first thought.
The tools available to me on my Linux system didn't quite seem up to the task, so I put the drive into the MacBook Pro, and booted into Recovery Mode (Command-R).
No problem there, the Disk Utility saw the drive, but flat out refused to resize it. I could create a new partiition in the unused space, but that wasn't quite what we had in mind.

In recovery I then opened up a terminal window.

The command "diskutil list" showed the full size of the drive and "diskutil cs list" showed there was a smaller physical volume containing  a logical volume "Macintosh HD"

A few Google queries later I found my self trying the (undocumented) diskutil resizedisk / diskutil cs resizevolume commands but both returned errors.

Edit: the command diskutil cs resizedisk returned:  this operation couldn't proceed because the target's boot helper was mounted

After a couple of iterations where I fine tuned my Google query I ended up with the following.