Removing All Partitions

I would like to completely wipe my MBP's hard drive, remove any and all partitions so that I may start with a truly fresh HDD. How can I achieve this using Terminal? Preferably in as few commands as possible.

MacBook Pro (15-inch Early 2011), OS X Yosemite (10.10.1)

Posted on Feb 24, 2015 10:09 AM

Reply
13 replies

Feb 24, 2015 10:13 AM in response to AMILkita

You can't. In order to do what you ask you must boot the computer from another disk such as the installer DVD that came with your computer or by using Internet Recovery: Computers that can be upgraded to use OS X Internet Recovery. If your model can do Internet Recovery, then see:


Install OS X Using Internet Recovery


Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.


Boot to the Internet Recovery HD:


Restart the computer and after the chime press and hold down the COMMAND-OPTION- R keys until a globe appears on the screen. Wait patiently - 15-20 minutes - until the Recovery main menu appears.


Partition and Format the hard drive:


  1. Select Disk Utility from the main menu and click on the Continue button.
  2. After DU loads select your newly installed hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
  3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed. Quit DU and return to the main menu.


Reinstall OS X: Select Reinstall OS X and click on the Install button. Be sure to select the correct drive to use if you have more than one.


Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.


This should restore the version of OS X originally pre-installed on the computer.

Feb 24, 2015 11:26 AM in response to AMILkita

Don't worry about that screen shot you provided with all the other drives. I don't know what all those are. That's normal while booted into the internal drive's Recovery HD or an external drive's Recovery HD or OS X installer. Your Mac OS X internal drive's partition is erased/empty.


As far as your other question What other drive would that be?, look at your last screen shot at /dev/disk1. That's the other drive which appears to be an external USB thumb drive (4GB) maybe?

Feb 24, 2015 10:40 AM in response to AMILkita

You have CoreStorage volumes (Mac HD appears to be the culprit). So you need to delete the Logical Volume Group (LVG) via Terminal.


Use an external source to boot from (e.g. Clone, USB thumb drive OS X installer, Internet Recovery - Command+Option+R).

Launch Terminal from the OS X Utilities - Utilities menu bar option.

Type diskutil cs list to find your Logical Volume Group UUID which will be a string of letters/numbers/dashes.

For example, E59B5A99-F8C1-461A-AE54-6EC11B095161

Then type diskutil cs delete UUID (replace UUID with the actual string of characters).

After successful delete of the LVG, open Disk Utility and check your partition structure.

Feb 24, 2015 10:34 AM in response to AMILkita

The Base System information is either a mounted installer or one that has been ejected. There is no need to worry about it. Based on this image you have selected the Toshiba drive - the out-dented entry at the top. From here just select the Partition Layout's dropdown menu and select one partition. Follow the instructions I've provided.

Feb 24, 2015 11:31 AM in response to keg55

Why Apple decided to convert portable Macs (laptops) to CoreStorage with the installation of Yosemite is beyond me. But it has caused confusion when trying to manipulate that partition or reinstall/restore to a prior OS. I have never gotten a mature/reasonable explanation from Apple employees about the CoreStorage conversion and I probably never will.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Removing All Partitions

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.