Want to sell your Mac, restore its original speed or make a fresh installation of the new OS version you bought? There comes a time in every Mac owner's life when the formatting (restoring it to a factory state) of the hard drive becomes a necessity. We'll tackle the most painless way to do so in this step by step guide.
Formatting Your Mac's Hard Drive
OS X: The operating system of choice for the modern artist, web designer, web developer, musician, journalist, photographer and more. Its Unix core makes it a solid backbone for developing software, while its user friendly, smooth overlay masks the complexity and enables casual users to wield it proficiently.
A running gag is that it's the rich man's Linux as much as Ubuntu is the poor man's OS X. But behind all that apparent reliability things still can, and probably will, go wrong. The system slows down with more applications added, and the efficiency of memory management will decrease with time no matter what the skeptics say.
But behind all that apparent reliability things still can, and probably will, go wrong.
Even if you never encounter a problem with your Mac, there will still come a time when you'll have to pass it on to someone else, and it is of vital importance that the Mac be as close to mint condition as possible - not only to give the appearance of a good-as-new machine to the new owner, but to avoid your saved private information (like passwords and other fine grained details saved deep in the OS) from falling into the wrong hands.
Formatting the Hard Drive is the only way to properly and completely remove all private data from your Mac
While this tutorial will cover the procedure for formatting your system drive, the same applies to formatting a new external drive if you bought one for storage purposes. The few differences will be noted further down in the article (see section “Formatting an External Drive”).
Booting from the Recovery Disk
In order to format the system drive, you need to boot your system from another location since the system cannot be asked to delete itself. If you have a Mac from the pre-10.7 era and don't intend to upgrade to a newer system, you'll need your original installation DVD.
Be careful! Installation DVDs are bound by version to the hardware they arrived with, so you can't just take your friend's 10.6.2 DVD if you originally got a 10.6.5 one. You'll be able to format your drive, but it won't let you install a different OS version from the one that arrived with your Mac originally.
To check if you have the correct DVD, try inserting it into your Mac while it's on - the installation procedure will try to start and will fail since you're running from the system disk, but it should progress enough to tell you “Mac OS X cannot be installed” if you have the wrong DVD.
Prior to OS X 10.7., the version written on the surface of the installation DVDs had to match the OS X version of the hardware they originally came with!
If you have a newer Mac (generation 10.7+, from late 2011 onwards), you should have a Recovery Disk in your machine. The Recovery disk is a small hard drive inside your machine that contains nothing but the basic OS X repair and installation files, thus letting you re-install OS X or fix a problem without an original DVD (in fact, 10.7+ Macs don't ship with an OS DVD at all). To check if you have the Recovery Disk, open the Terminal and type:
If you see this line then you have the recovery disk installed into your Mac.
Apple_Boot Recovery HD 650.0 MB disk0s3
Upgrading with a Fresh Installation
There is another use case. What if you have 10.7 or later, and want to upgrade to Lion or Mountain Lion with a fresh installation of the system? It's a bit of a pickle, since there are no DVDs for Lion or Mountain Lion to be had, but you can make one yourself.
First, buy the OS, or re-download it if you already bought it. It is important that you have the file called Mac OS X Mountain Lion Install. Then, to manually create a bootable USB stick or DVD, follow the instructions in this article.
Now that we're sure that we've got a Recovery Disk, the original installation DVD or a bootable USB drive, it's time to boot from said media. If you have the Recovery Disk, reboot your machine and instantly press and hold CMD+R. If you are booting with the DVD, reboot and press and hold C. If you're booting from the USB stick, press and hold the Alt (Option) key while booting to summon the Startup Manager, and select the USB when it shows up.
The Option key way of booting can also be applied to booting from CD or Recovery - just select the media you want to boot from in the menu. Make sure you press and hold the aforementioned keys before you hear the boot chime. The remainder of the procedure is identical regardless of media you boot from.
Using Disk Utility
Once the boot process has finished, you should see a selection screen something like this:
Select Disk Utility. If there is no Disk Utility option on the main screen, look for it in the top menus under “Utilities”. Once it opens, you'll be given a list of all hard drives currently available:
Select your system drive (usually the first one near the top) and go to the Erase tab. There, you can select the format of the newly formatted hard drive, the name it will show in the list of devices, and add some security options to prevent recovery of deleted data.
The format is the file system type that will reside on the disk. If you intend to easily access the drive with both a Windows machine and your OS X, select FAT32. This is not recommended, however, as FAT32 does not support files with size greater than 4GB, and the system disk of OS X cannot be on such a format type.
FAT32 is only marginally recommended for storage devices that are used by many different machines of many different operating systems, and only if you know you'll never need 4GB+ files (goodbye HD movies!).
Ignore the MSDOS FAT option unless you know you really need it.
The logical choice for an OS X system disk is Mac OS Extended Journaled (you might not even have non-journaled on older systems). But which one? Let's take a look at a brief rundown.
Journaled has an extra mechanism that avoids file corruption if the power is cut suddenly during read/write operations on the disk. It might be a bit slower than non-journaled, but it's way safer.
Now, there's the additional option of Case Sensitive Journaled vs. Case Insensitive Journaled. The default for OS X is case insensitive, which means that files file.dmg and File.dmg cannot exist in the same folder - they are regarded as identical in name. As a web developer, I frequently deploy my code to CentOS servers and other Linux distributions, and Linux (and Unix in general, by default) is case sensitive, which means the aforementioned files can coexist. So to avoid all case-related problems before they happen, I always format my work Mac to case sensitive. I hadn't had any case sensitivity problems so far, but better safe than sorry.
If you intend to run games or install Steam (more on that in an upcoming article), you need to pick the case insensitive version. If that isn't complex enough, we also have (depending on the OS/Disk Utility version) the ability to pick encrypted over non-encrypted. While the direct benefits of encrypted over non-encrypted fall outside the scope of this article, it's worth mentioning that what this does is password encrypts the files on your drive so that if it's accessed directly (i.e. not through being logged in as you), the files will be useless. This option can be activated later in the OS Preferences, so we won't pick that right now. So if you're a casual user or don't fear case clashes with Unix systems, pick Mac OS Extended (Journaled).
Whenever something is written onto a physical hard drive, a little physical mark is made, a dent if you will. Unless written over, these “traces” can be used to recover lost data from a hard drive, so the only way to permanently delete information from a standard plate-based (non-SSD) Hard Drive is to “zero it out”.
You might know that all information on a computer is written in binary form: ones (1) and zeros (0). So when you zero out data, the computer actually writes zeros over the locations where the data resided, thus covering the tracks of the previous information with nothing but empty space (empty space is not actually empty - it's a bunch of zeros).
The more passes it makes (it can write zeros multiple times over previous layers of zeros), the harder it is to recover said data. This is where Security Options come in - the most basic option simply erases it once, converting data into empty space. The additional options tell Disk Utility to zero it out once or multiple times, and the more passes it makes, the harder it will be for the next owner of the Hard Disk to recover your information. Select whichever you see fit, but keep in mind that more passes last far longer, sometimes well over a day or two if the disk is large.
Zeroing out data is the only way to completely eradicate data on a standard hard drive. More zeroing passes means more security.
You might notice another tab: Partitioning. If you would like to split your hard drive into several smaller parts (partitions), you can do so there. A partition is a separate logical entity and acts just like a separate hard drive. It can even have its own file format (for example, setting one to case sensitive and the other to case insensitive).
Having separate partitions is a good thing if, for instance, you frequently work with large media like huge resolution Photoshop files - that way you can make a 20GB partition and dedicate it solely to Photoshop's scratch files. Having multiple partitions can also be useful for safety reasons - if one partition fails, others might not, though keep in mind that if a hard drive fails, all partitions on it will, too.
Note that the first partition is fastest, with others slowing down. The more on the outer parts of a hard drive a partition is, the faster it will perform.
Formatting an External Hard Drive
If you bought an external hard drive, it too needs to be formatted before use. Luckily, this can be done without any complicated booting procedures - all you have to do is plug it in, open Disk Utility while your Mac is working as usual, select it in the sidebar and follow the same procedure described above in the “Using Disk Utility” section.
External hard drives can be formatted without rebooting - just plug them in and run Disk Utility
Once you go through all of the options above, click Erase. The formatting process will begin, and once it finishes, your hard drive is squeaky clean and as good as new. It's as simple as that!
If you were formatting an external hard drive, it's ready to be used. Just leave it plugged in and use it as usual. If you were formatting your system drive, close Disk Utility and follow the on screen instructions to proceed with the installation of your OS.
As you can see, formatting a hard drive can seem like a daunting task, but is usually quite simple. By following this tutorial, you now know how to do it yourself, without paying someone to do it for you and without scratching your head and wondering where to go next. Your freshly formatted Mac is now ready to be passed to its next owner, or to accept a fresh version of the OS.
System tasks like these are worth knowing as they make self-maintenance of your computers infinitely easier, so please, give it a shot and spread the word. If you run into problems, please tell us and we'll try to work through them together.