OSX, the Air and Recovery Mode, or how to make amazing software

on Wednesday, October 12, 2011
This morning I decided I needed a case-sensitive partition on my MacBook Air. It comes with a nice juicy 250GB SSD and I still have about 140GB left, so, having woken up in an adventurous mood, I open up Disk Utility, peer at the partition, note it doesn't complain at me if I shrink it a bit, so I go ahead and resize it. I do this, of course, without killing any of the 30 tabs open on Chrome, or closing down the 3 server connections and about 30 channels on LimeChat, not to mention the 10 terminal sessions running various scripts and remote shells, or any of the ton of widgets and apps happily fidgeting in the background. Life is good.

The resize finishes with no issues, which of course only encourages me, so I go ahead and create a new partition occupying the space Disk Utility says it's free (who am I to argue, I'm sure it can do the math better than I can).

"Error: no disk space left to perform the operation"

Or something to that effect, anyways. I wonder if it might be too early for Disk Utility. You know, math this early in the morning, tricky. I reboot, because that always fixes things, right? After a few seconds (yes, SSD is that awesome) of fretting about whether I still have a working Air or whether I'm now Airless, it boots. Disk Utility isn't fooled, though, it continues to complain that the space it has free isn't big enough to create a partition.

It's at this point that my brain kicks in and I run verify on the drive and on the startup partition. Just because the resize finished with no errors, that doesn't mean it didn't actually screw things up, leaving behind a trail of dead bytes all over my drive. It just means it was sneaky about it. A bit like coming home and finding the cat nicely tucked away on her beanbag like a good obedient little kitty, but having the sofa all covered in cat hair. And feeling warm to the touch. As if a certain fur ball had just leaped off of it and onto the beanbag and then pretended to have been there all along. Sneaky.

So, after glaring at the cat (pretending to be fast asleep, snoring loudly, pink tongue jutting out in blissful forgetfulness, the sneak), I repair the partition. Or try to, because this time I get complained at repeatedly with red menacing messages and a popup, indicating I need to run the Installation Disc to start Recovery Mode and run Disk Utility from there. After a careful examination of the Air to make sure it hasn't sprouted a DVD drive while I wasn't looking, I quickly google for the proper procedure to apply to the boot process in order to go in to recovery mode, and reboot again.

Now it seems to me that this thing, not having an optical drive, would come with a recovery partition from which one would boot when needed. Maybe it's just the Air pouting, but when I hit Command-R, instead of offering to boot from the recovery partition, it went online. Online!

I have to confess, I was amazed and, quite frankly, boggled. This little gray metal thing that I'm obviously trying really hard to turn into a paperweight is going online to fetch an image of the recovery partition so it can load it and boot it on the fly. If I was impressed before that OSX allowed me to resize the system partition just like that, now this is some seriously impressive recovery process. I mean, really, I've blown up more partition tables than you could shake a stick at (the latest one was a combination of partitioning a portable drive on osx and then formatting said drive on linux and copying a whole bunch of stuff onto it so I could take it on vacation, and then when I'm on vacation 300km from home trying (haha) to use it on the mac, and then having to realign partition tables by hand on the command line), and although I usually don't lose anything except time, the recovery process is always sooooo annoying. This whole OSX recovery process was obviously done for silly people like me.

While I'm boggling at it, it does its magic thingy and lo-and-behold! Recovery Mode! I run Disk Utility, hit Verify, hit Repair. Things work, apparently, so I try again to create the partition. It creates it. I reboot and I'm back to normal land. And stuff still works.

With the hardware limitations of the Air and the possibility of not having a recovery partition, this whole recovery process is an amazing piece of well-designed software. Instead of having to waste hours trying to recover things manually, everything Just Worked (tm) and I could instead waste my time writing this blog post! It has made my day.

Oh, and poking the cat. That has also made my day. The sneak...