The problem with using Disk Utility or dd if=/dev/zero to erase a disk is that:

  1. It applies unnecessary wear to SSD drives.

  2. It sends the drive's capacity worth of zeroes over the drive's interface. If you're on an older Mac that has a poorly performing USB 2 ports, it'll take much longer than necesary. It'll also tax your CPU and USB subsystem with sending all those zeroes around.

  3. The firmware-based secure delete can be much faster than sending zeroes to the drive, even on spinning platter drives. For drives with encryption support, it'll be almost instantaneous, as all the drive needs to do is to overwrite the encryption keys and the data becomes useless. On those drives, and on SSDs, a secure erase should take 1-4 minutes (!).

All modern drives support ATA Secure Erase commands. These commands have the drive's firmware perform the erasure of the data.

On Linux, the hdparm utility exposes this functionality to the user - see hdparm --security-help for details.

Unforunately, there's no hdparm for OS X, since OS X doesn't provide any way for userland to send arbitrary SATA commands to the drive :(

Is there an easy workaround?

There are three ways of dealing with it:

  1. OS X provides good userland access to any USB device, so if one wished to bundle hdparm with a USB storage driver, it'd be possible to use hdparm on USB-connected devices to perform secure erasure.

  2. Alternatively, you could write a kernel driver to expose this functionality to the userland.

  3. Finally, you can use a virtual machine running linux, since both VMware Fusion and VirtualBox expose USB devices to the guest. I'll detail this last solution here.

The steps are:

  1. Buy a USB 2 or USB 3 hard drive enclosure. I've verified that the NexStar NST-D306S3 dock works great.

  2. Plug it into a USB 2 port. I never got it working with USB 3 ports, due to bugs in Linux kernel.

  3. Set up a new VM and attach systemrescuecd image to the virtual CD drive. The VM does not need a hard drive, and needs only 256 MB of RAM.

  4. Boot up the VM. Attach the drive to the VM.

  5. Ensure that only one USB device is attached to the VM. This storage device will be available as /dev/sda.

  6. Issue the following commands on sysrescuecd's console:

    hdparm --user-master u --security-set-pass NULL /dev/sda
    hdparm --user-master u --security-erase NULL /dev/sda
    

    That's it. Your drive will be completely wiped by its own firmware, without using any appreciable amount of USB bandwidth, CPU, nor drive's write endurance (for SSDs). This works perfectly even on the earliest Intel Mac, and won't slow the machine down any. You can use VMware Fusion or VirtualBox, both work equally well for this purpose.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.