I had to clean my old Macbook Pro 15 and Macbook Pro 15 Retina laptops before I got rid of them, so I wanted to be able to install a new, clean, version of Mac OS X Mavericks and ensure that none of my apps and data is left on the computer. I don’t have a CD with Mac OS X Mavericks v10.9.2 (nor an optical drive for that matter). Since Mac OS X v10.9.2 is a free update, getting a copy is pretty easy, but Mac OS X does not have an easy mechanism that lets one build a USB bootable version for a clean install. Here’s a way to do just that in a few steps
Before you start
You will need the following:
- an access to the Mac App Store (an Apple user account)
- have Mavericks v10.9.2 free update installed on your mac (the script will rely on this and won’t work on Mac OS 10.6. Update to Mavericks before taking the steps below.
- a USB drive with 8GB of space
Step 1: prepare a target USB drive
Prepare a USB disk of 8GB+ to receive the Mac OS Mavericks installation (the compressed download from the App Store is 5.3GB, so it will expand somewhat on our disk). Insert it into a USB slot and launch the Disk Utility. Erase all data and rename the drive to a specific name: the script that we will use later will erase the data again, but it does need the correct name for the USB drive.
Format the drive using “Mac OS Extended (Journaled)” and use a new name. I’m using mavericksinstall. If you already have a volume using that name, pick another name and change the script below accordingly).
Before doing this, verify that there is nothing that you need on this USB drive – data from it will be lost.
Step 2: retrieve the Mavericks.app file from the Mac Store
Download Mavericks from the Mac Store. You have to do this since the Mavericks.app installation file was deleted at the end of the previous upgrade. The Mac Store will save it as a file on disk, and we will use a script to quickly access it.
As you download it, the Mac Store will point out that you are already running on Mavericks, but click on Continue and it will download the file.
Step 3: install Mavericks as a bootable USB drive with a script
Open a Terminal Window and copy or type the following command:
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia –volume /Volumes/mavericksinstall –applicationpath /Applications/Install\ OS\ X\ Mavericks.app –nointeraction
This command will basically delete data on the USB drive, and it will make it bootable using the update file downloaded from the store, and named Mavericks.app. It will also install a recovery partition on the USB drive, so don’t be surprised to see it later. Thanks to forum user tywebb13 for sharing this command.
The process will take a while, and you will see something like:
Erasing Disk: 0%… 10%… 20%… 100%…
Copying installer files to disk…
Making disk bootable…
Copying boot files…
Step 4: Reboot on the USB drive and start the clean install
Go into the settings, and select the boot drive. Pick the newly built USB drive with the installer for Mavericks and restart.
You can also reboot your Mac and hold the “Options” key to enter the boot menu. Pick the USB drive to boot on it and start a clean Mac OS X Mavericks installation.
Step 5: All done, happy clean installation!
Hopefully, the installation should be easy and by now, you have a clean Mac with Mac OS X Mavericks. Enjoy!
If you know an easier way to do this, let me know and I’ll be happy to give it a try. If you can’t make it work, double-check that the USB drive volume name matches the name in the script.