Monday, October 28, 2013

Making an OS X Mavericks USB Installer

I have put off updating my OS X install since Snow Leopard. All the applications I have wanted to use were supported on Snow Leopard, and even people I know who worked for Apple were unable to give a compelling reason to upgrade. Very recently (within the last two weeks) I have found just two applications that I was interested in, but unable to install on my vintage OS X. So I began looking to upgrade, and to my surprise the most recent version of OS X (10.9 Mavericks) was a free upgrade.

There were some things that I had done to my existing installation that I wanted purged, and it had collected clutter since Snow Leopard was first released - yeah it has been a very stable OS.  The solution was to make a bootable USB drive.  There are no shortage of tutorials on various pages for doing this, and a number of developers have even created applications to take care of the dirty work for you. The problem was that none of those methods were working for me.

It seems that they were all running into problems formatting the drive I was using, and I am still not sure what the problem was.  After running the following command

$ sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction

And entering the necessary credentials I got the following error (complete with an grammatical error).

Failed to start erase of disk due to error (-9999, 0).
A error occurred erasing the disk.

Several Google searches for an explanation or workaround yielded little help. Luckily I stumbled onto a macworld tutorial that offered a more manual way to create a Mavericks USB drive.  The section of interest is the one labeled "Option 2: Use Disk Utility."  I was able to use these instructions when nothing else would work.  Here is a simplified set of instructions:

  1. Mount InstallESD.dmg - once you have downloaded Mavericks to your main Applications folder, right-click the installer, and choose Show Package Contents from the resulting contextual menu.  In the folder that appears, open Contents, then open Shared Support; you'll see a disk image file called InstallESD.dmg.  Double-click InstallESD.dmg in the Finder to mount its volume.
  2. Mount BaseSystem.dmg - using Terminal with the command
    $ /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg
  3. Restore BaseSystem.dmg to the destination partition - launch Disk Utility and Select BaseSystem.dmg in Disk Utility’s sidebar, and then click the Restore button.  Drag the BaseSystem.dmg icon into the source field on the right, and the properly formatted destination partition into the destination field.  Click Restore, and wait for the restore procedure to finish.
  4. Replace the Packages alias with the real thing - open the destination drive, open the System folder and then open the Installation folder. Delete the alias called Packages.  Open the mounted OS X Install ESD volume, and drag the Packages folder into the Installation folder on your destination drive (you are replacing the deleted Packages alias with this Packages folder). 

I now have a clean installation of OS X, and so far it is OK.  I have had some issues with Google Chrome's Flash process keeping my MBP awake and draining the battery, but so far nothing earth shaking. That's how it should be; operating systems should be boring. To quote Linus Torvalds:

Guess what? Wheels have been round for a really long time, and anybody who "reinvents" the new wheel is generally considered a crackpot. It turns out that "round" is simply a good form for a wheel to have. It may be boring, but it just tends to roll better than a square, and "hipness" has nothing what-so-ever to do with it.

This isn't to say that performance and security updates are not necessary and welcome improvements, but who cares about the latest iOS/OS X blah feature that will change your life.  For me a good terminal and a decent browser have been almost all I have needed for the last three years...especially on a laptop. On a side note I did upgrade to an SSD at the same time, and that was an amazing performance upgrade.