How do I completely wipe a drive on MacOS?

Discussion in 'macOS' started by Doc69, Nov 1, 2017.

  1. Doc69 macrumors 6502

    Dec 21, 2005
    I need to completely wipe a drive. In the past, I've done it on a Windows machine, using the command prompt command 'Clean'. This made the 'Initialize' window pop up once I attached it to a Mac. Is there a way to do the same 'cleaning' from the Mac, perhaps using Terminal commands?

    I don't need to erase drive for security, I just want to wipe all MBRs, EFI partitions etc, and make the drive completely empty.
  2. Fishrrman macrumors P6


    Feb 20, 2009
    I think you can do this with the "Parted Magic" application.

    It can be downloaded and burned to a bootable CD (of course, you'll need a DVD/CD drive).

    It -might- be installable to a USB flash drive, from which you could boot, as well...
  3. HenryAZ, Nov 3, 2017
    Last edited: Nov 6, 2017

    HenryAZ macrumors 6502a


    Jan 9, 2010
    South Congress AZ
    Use diskutil in a Terminal window. Just make sure you get the correct deviceID, from diskutil list. It will take the form of /dev/disk3, for example.

    # We need:
    # 1. deviceID - (diskutil list), something like /dev/disk9
    # 2. #Parts - number of partitions
    # 3. PartType - GPT or MBR
    # 4. Triplet - one triplet for each partition - Format VolName Size
    # Formats:
    # ExFAT ExFAT
    # Free Space Free Space
    # (or) free
    # MS-DOS FAT12 MS-DOS (FAT12)
    # MS-DOS FAT16 MS-DOS (FAT16)
    # MS-DOS FAT32 MS-DOS (FAT32)
    # (or) fat32
    # HFS+ Mac OS Extended
    # Case-sensitive HFS+ Mac OS Extended (Case-sensitive)
    # (or) hfsx
    # Case-sensitive Journaled HFS+ Mac OS Extended (Case-sensitive, Journaled)
    # (or) jhfsx
    # Journaled HFS+ Mac OS Extended (Journaled)
    # (or) jhfs+ Recommended!
    # VolName = whatever
    # Size = #B, #KB, #MB, #GB, #TB, #% (50%, 100%), R (remainder)
    # Command looks like this:
    # /usr/bin/sudo /usr/sbin/diskutil partitionDisk deviceID #Part PartType Format VolName 100%
  4. Michael MP2 macrumors member

    Nov 2, 2017
    If I need to start from scratch I'll either use a CD/USB with Gparted (linux partitioning utility live system), boot from that, then erase everything, or boot from an external copy of OS X, wipe it, and then use a disk editor to remove any remnants of the old partition scheme.

Share This Page

3 November 1, 2017