Hacker Codex   Linux servers · Python development · macOS tinkering

How to Clean-Install macOS

Clean-installing macOS can make your Mac faster and more reliable by clearing out the operating system cobwebs. Sometimes referred to as “bit-rot,” various files can become outdated or corrupted, hobbling your computer’s speed and sometimes yielding crashes. After using a computer for a few years, with several in-place upgrades performed over that time span, there inevitably comes a time when I decide to erase the drive and cleanly install the latest version of the Mac operating system. I call this going “scorched earth.”

For clean installations, I prefer to create bootable installers on USB drives. This isn’t strictly necessary, as Apple provides alternative methods that don’t require creating bootable installers. Here’s why I do:

  1. they can be used to install on more than one Mac
  2. because I’m old-school

What You’ll Need

  • the administrative password for your Mac
  • 8GB or larger USB drive (flash/thumb drive is fine — will be completely erased)

Back Up Your Mac

Before you do anything, back up your Mac. Right now.

By ensuring that you have backups of all the data on your internal drive, you will then be able to move back over certain applications, documents, and other files that you actually want to keep — while leaving the unnecessary detritus behind.

Please note that this latter process — copying back over the data/files you want to keep — is beyond the scope of this article. So if you don’t feel totally confident that you know how to do that, please do not continue with the rest of this guide. Instead, find someone who can help guide you through the process.

Download macOS

  1. Tap the following link to go to App Store, then tap the Download button: macOS Mojave

  2. Once the macOS download finishes, the installer will automatically be launched. We aren’t ready for that yet, so go to the Install macOS Mojave menu and select Quit Install macOS to quit the Installer app without performing the installation.

Create Bootable Installer

  1. Insert 8GB or larger USB flash/thumb drive. Rename to: MacInstaller
  2. Launch Disk Utility (Finder > Applications > Utilities > Disk Utility)
  3. From left-hand sidebar, look under External and choose MacInstaller
  4. Tap on the Erase tab at the top of the window.
  5. Select Mac OS Extended (Journaled) from the format list and then tap Erase.
  6. When done, tap Done and quit Disk Utility.
  7. Launch Terminal (Finder > Applications > Utilities > Terminal)
  8. Enter the following text and then hit Return: sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MacInstaller
  9. Enter your administrator account password and hit Return. This is the password you use to make changes on your Mac or log in. No text will appear in Terminal when you enter the password. When prompted, enter Y to confirm that the drive will be erased and hit Return again.

The last step will take a long time. When finished, it will report: Done.

(If you need more detail regarding this process, refer to Apple’s documentation: How to create a bootable installer for macOS)

Clean Install macOS

  1. Leaving your installer drive connected via USB, restart your Mac.
  2. The screen will turn off for a moment. Before the screen lights up again, hold down the Option key until you see a list of drive icons.
  3. Use arrow keys to select the install macOS Mojave icon and hit Return.
  4. Choose Disk Utility and then Continue.
  5. In the left-hand sidebar, select your internal drive and then tap the Erase button in the top toolbar.
  6. Ensure the Format drop-down menu is set to: OS X Extended (Journaled), and then tap Erase.
  7. Erase step should complete quickly. Tap Done button and quit Disk Utility.
  8. Select Install macOS and then tap the Continue button.
  9. Scroll through license agreement and tap the Agree button.
  10. Select your internal drive and tap the Install button.
  11. Ignore the wildly inaccurate time estimate and go do something else. You’ll know the process is done when you see a macOS setup screen.
  12. After a long wait, you will see a welcome screen asking you to choose a country/language. Make your selection and tap the Continue button.

Continue going through the initial Mac setup process. Once login completes, eject the Install macOS Mojave USB drive.

Migrating Your Data

Re-installing macOS from scratch means that none of your data has come along for the ride, with the possible exception of contacts, calendar events, and any other information that you’ve chosen to synchronize via iCloud. There are two primary choices for migrating your data: manual and automatic.

Manually Copy Data

If you have reason to believe your old macOS installation had problems that would be carried over to your new system if you performed an automatic migration, you can attempt to manually copy over your documents and other data. This is rarely necessary, requires intimate knowledge of macOS and its data locations, and will almost always result in something not getting migrated that you actually wanted to be migrated. Therefore, this is a last resort and should only be attempted if you really know what you’re doing.

Automatic Migration via Migration Assistant

Most people will be better served by the Migration Assistant application, which automatically migrates your data from another Mac or backup. You made a Time Machine backup just before re-installing macOS, right? Good. The first time you boot into your new macOS installation, during the setup process you may be asked whether you want to transfer information to it. That is a good time to connect your Time Machine backup drive to your computer, select the “Time Machine backup” option, and select your Time Machine backup drive as the migration source. For more details regarding this process, refer to Apple’s Migration Assistant documentation.

Final Thoughts

Clean-installing macOS is no panacea, but I (and some of my friends and family) have been very pleased with the results. It can make an old Mac feel new again, which sometimes can be well worth the hassle of setting everything up again from scratch. (And yes, that is definitely a hassle.)

Any thoughts on this topic? Suggestions for improvement? Please reach out and let me know!

Want to be notified when I publish new technical tutorials?