The Safe Mac

Follow The Safe Mac on Twitter to stay advised of the latest Mac security news!


How to reinstall Mac OS X from scratch

Posted on April 11th, 2013 at 11:11 AM EDT

info

For whatever reason, you have decided that you want to reinstall the system from scratch, restoring your machine to an “out-of-the-box” state. Regardless of the reason, this is not something to be undertaken lightly. The possibility of data loss looms any time you erase your primary hard drive. Further, if you do the job wrong, whatever problem you’re trying to solve may not even be solved. Fortunately, there are some easy steps you can take to do the job right.

Before I start, note that if you are trying to get the machine ready to sell, you should follow some slightly different directions. See How to prepare your Mac for sale.

Step 1: Back up!

Backing up your data is something you should be doing on a regular basis – every single day, for most people. However, any time you propose erasing your primary data storage, it becomes critical. You must do it right, or you will risk losing data. So how do you do it right? Most importantly, make redundant backups. If you only have one backup, remember that when you erase your hard drive, those backups become the one-and-only copy of your data. That’s an extremely vulnerable state to be in. Don’t put yourself in that state. Before erasing the hard drive, make sure you have a minimum of two completely separate backups, on completely separate media, and preferably made with two different backup programs. I highly recommend Time Machine to back up to one hard drive or a Time Capsule, and Carbon Copy Cloner to back up to one or more additional hard drives.

For more details, see my Mac Backup Guide.

Note that, for the purposes of these instructions, I will assume that you have a backup clone (ie, an exact copy of your hard drive’s current state) made with something like Carbon Copy Cloner.

Also, note that if you’re running Lion or later (Mac OS X 10.7 and up), before making that clone backup, it would be extremely helpful if you were to run the following command in the Terminal (to make sure your user Library folder is visible on your backup):

chflags nohidden ~/Library

Step 2: Erase the hard drive

If you plan to install Snow Leopard (Mac OS X 10.6), or any previous system, insert the appropriate Mac OS X install disc and restart the computer. Hold down the ‘c’ key as soon as you hear the chime, then let go when you see the Apple logo. The system should eventually boot into the installer, where you first must choose a language. Do so, then choose Disk Utility from the Utilities menu.

If you plan to install either Lion or Mountain Lion (Mac OS X 10.7 or 10.8), restart the computer and hold command-R as soon as you hear the chime. When you see the Apple logo, you can let go. This will start the computer in recovery mode. Once you have fully booted into recovery mode, open Disk Utility. Note that when you begin the install process, you will need to download about 4 GB of data, so be sure your internet connection can handle that before proceeding.

Once in Disk Utility, you need to select your hard drive in the list and select the Erase tab. Select “Mac OS Extended (Journaled)” from the Format pop-up, if that’s not already chosen, then click the Erase button. When Disk Utility is finished, choose Quit from the Disk Utility menu.

Step 3: Reinstall

This step is pretty simple – just follow the directions to reinstall the system on the newly-erased drive.

One important thing to know, though, is that you don’t want to let the installer import anything from backups when it finishes. That can import more than you want, and that could very well bring back whatever bad settings file or third-party software or whatnot that is causing the problems you’re trying to solve in the first place. Instead, when the installer finishes, import nothing, and go through the setup process as if this were your first computer.

Step 4: Update

Once your system restarts successfully, you will need to be sure that it is fully up-to-date. From the Apple menu, choose Software Update, and install any updates that show up. Installing from older system disks can leave you with a somewhat outdated system, so you’ll want to be sure that you take care of bringing it back up to speed.

If you reinstalled Mac OS X 10.7 or 10.8, this should not be an issue, since you will have downloaded the most up-to-date version. Still, it can’t hurt to go ahead and check for updates anyway.

Step 5: Reconfigure

Once your clean, new system is up and running and fully updated, work on getting all the settings back to the way you like them. Don’t worry about getting things like Mail or iTunes set up again yet, though. Just make sure to do things like get connected to your wireless network, get your mouse/trackpad settings back the way you like them, set up your printer again, etc.

Step 6: Import data (selectively!)

At this point, you can manually copy your user data from the clone backup back into your new user folder. Don’t try to copy any settings files – nothing from your Library folder, for example – just documents.

When it comes to restoring data for apps that are not document-centric, like iTunes, iPhoto or Mail, you need to find and copy the data from your backup to the same location on your new drive. The items you need to copy for such apps are found in the following locations (note that the ‘~’ means “your home folder”):

iTunes ~/Music/iTunes
~/Library/Preferences/com.apple.iTunes.plist
iPhoto ~/Pictures/iPhoto Library
~/Library/Preferences/com.apple.iPhoto.plist
Mail ~/Library/Mail
Mac OS X 10.7 and earlier: ~/Library/Preferences/com.apple.mail.plist
Mac OS X 10.8: ~/Library/Containers/com.apple.mail

Copy the files/folders from those locations on the backup to the same location in your new user folder. For other apps, you may need to search for instructions on where to find the data and preference files.

Step 7: Reinstall applications

At this point, you can start reinstalling any other applications you might have had installed. Do not try to copy them from your backup. Reinstall them from the original disks, or download them from the original source.

Note that if you’re trying to solve problems like frequent system crashes or performance problems, this step is one that you should draw out over an extended period of time. Don’t just slap every application you had back onto the new system! If you do, and one of those applications was causing the problem, you’ll never know which one it was and you’ll be back at square one, with a lot of time wasted. Install third-party applications one at a time, with a period of testing afterward to be sure the problem doesn’t come back.

Once you have completed the seventh step, you should have your machine back to a state pretty close to where it was before, though hopefully without the issues that caused you to go to all this trouble in the first place.

Post to Twitter

Tags:


14 Comments

  • PTS says:

    Just out of curiosity, let’s say that somehow I manage to get some sort of malware on my Mac and I decide to reinstall from scratch. Is it enough to choose Erase? if I choose to Zero Out Data, would that be too much?
    Are the results of Erase command similar to Format option from Windows?

  • Tom says:

    While just hitting Erase gives you a clean drive to reinstall to, it would be a very good idea to to zero the data. The zeroing touches every block of the drive, so if you do have a bad block it would be found and retaliated to a good block. This would be more important on a drive 3 years and older vs a newer drive. Just a good “best practices” way of doing things. Of course, this is only needed on a conventional spinning HD and not needed on a SSD drive.

    • Thomas says:

      The idea that zeroing the drive fixes bad blocks is a common one, but it’s no longer entirely accurate. It was true years ago, but modern drives automatically map out bad blocks as they are encountered. Zeroing the drive these days is only important if you want to wipe the data and prevent it from being recoverable.

  • Timothy says:

    I’m wanting to upgrade from Snow Leopard to Mountain Lion, but I don’t want to just install ML over SL. I really want to do a totally clean install of ML. Is there a straightforward way to accomplish that?

    • Thomas says:

      You can download the Mountain Lion installer, then make a bootable install disk out of it and use that to erase the hard drive and install ML.

      • TImothy says:

        Thanks for that Thomas.
        That procedure looks doable!

      • please says:

        Hi Thomas,

        Would you know if with that bootable disk, if you would still be prompted to make the ~4GB download? I’m looking for a solution that would allow to install ML in an offline situation.

        • Thomas says:

          If you make a bootable install disk according to those directions, then you can install in an offline situation. That’s the only way to create a Mountain Lion installer that does not require downloading the system at the time of installation! Of course, those installers will only install a specific version of Mountain Lion, so you’ll probably need to download updates to get it up to the latest version, while the version you get when using an install method that downloads from Apple’s servers is the most recent and requires no updating. It’s not easy to get entirely away from downloading these days!

This post is more than 90 days old and has been locked. No further comments are allowed.

This page and all contents (unless otherwise noted) copyright 2011-2014 by Thomas Reed.
For questions or comments, please contact me.