Ask HN: What's the best way to delete all data off of a drive?

17 points by tbirdz ↗ HN
I have a laptop that I want to sell, but on the hard drive I used to keep sensitive information, like tax records, personal photos, etc. What is the best way of processing this drive to remove all of this, and make it so no one could be able to recover it?

22 comments

[ 3.3 ms ] story [ 56.8 ms ] thread
I can't find it but there's a $10k prize around for anyone able to recover data from a drive overwritten once with all zeros.

Use something like DBAN [1] and forget about it.

(Happy to be corrected)

[1]: http://www.dban.org/

I don't think only writing zeros is considered safe, I mean it probably is for most purely software based recovery methods but I don't think it is for agencies with money to build the right hardware. Look into DoD 5220.22-M.
(comment deleted)

  for ATA disk drives manufactured after 2001
  (over 15 GB) clearing by overwriting the media once is adequate to protect the media from
  both keyboard and laboratory attack.
--NIST, 2006 - http://csrc.nist.gov/publications/nistpubs/800-88/NISTSP800-... (page 14)

Found that while looking up the DoD standard, interesting stuff - thanks!

Recovery from an overwritten file has essentially never been done. Or if it has, it has been kept top secret.

There was one study a long time ago where a few bits were recovered with some accuracy with an electron microscope, but it was from a really old hard drive with a much lower density than current ones.

Those overwriting regulations are just in case such technology might get invented in the future.

Don't use DBAN if you have a SSD. Instead, use Secure Erase.

1. Secure Erase will only take a few seconds.

2. DBAN is going to shorten the life of the drive.

3. Yes, recovering data that has been overwritten is unlikely. However, DBAN is likely to not write over the data in the first place. It has no control over where the data is written. That's handled by the SSD controller. DBAN will only think it wrote zeros over the entire drive, while not actually doing so.

Right! I've been using spinning rust drives for longer than I've been using SSDs - thanks for the tip.
dd if=/dev/zero of=/dev/yourharddrive
I like to know the most secure way to wipe a SSD. Apparently the google doesn't have much on it.
SSDs can only tolerate a limited number of writes. A secure wipe of a SSD would significantly reduce its lifespan.
I know, which is also why it's so hard to wipe it. It seems that SSDs are built with self preservation in mind and it'll try its hardest to avoid a write.
In most cases you're after the the ATA secure erase command. Read the hdparm man page, look for --secure-erase.
Depending on your degree of paranoia:

If you're just an ordinary Joe/Joelle:

- write 'all zeros' to the whole drive

If you've been committing small time crime:

- (the above+) write 'all ones' to the whole drive

If you're a big time crime boss (say Escobar level):

- (the above+) disassemble the drive

If you're either Edward Snowden or Julian Assange:

- (the above+) smash controller to bits, sandpaper platters

If you're Osama Bin Ladens cleaning lady:

- (the above+) melt down the drive elements

Imho anything above except for step (1) is overkill.

People can recover more then 1 rewrite (zero's and 1's) easily.

Do it 50 times, then it should be safe (if your paranoid, melt the drive though)

It would be nice if you quoted some reputable source or research when making such bold claims.

Who are the people that can recover more than 1 rewrite easily from a modern hard disk drive, do you have any URLs at hand?

You could check Peter Gutmann's research titled "Secure Deletion of Data from Magnetic and Solid-State Memory" [1] from 1996 which is one of the original sources for "35-cycle erase" [2]. In this paper he states that it is possible to recover the data using a specialized microscopy equipment (using Magnetic Force Microscopy or MF Scanning Tunneling Microscopy techniques). These techniques are only applicable for mediums with a much lower magnetic density and much simpler encoding than are used these days (eg. RLL encodings like MFM, PRML, etc.).

How did you arrive at the number 50? In the epilogue of his paper Gutmann states:

In fact performing the full 35-pass overwrite is pointless for any drive since it targets a blend of scenarios involving all types of (normally-used) encoding technology, which covers everything back to 30+-year-old MFM methods (if you don't understand that statement, re-read the paper). If you're using a drive which uses encoding technology X, you only need to perform the passes specific to X, and you never need to perform all 35 passes.

tl;dr: overwriting 35 times is a pointless waste of time and is one of the popular myths that refuses to die. Using shred under GNU/Linux or DBAN to overwrite with some random data is more than sufficient for our purposes.

[1]: https://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html

[2]: http://en.wikipedia.org/wiki/Gutmann_method

Before you wipe the drive you could do a whole drive encryption with TrueCrypt or BitLocker and then use DBAN for spinning drives or Secure Erase for SSDs.
I used to work with classified data.

"We" incinerated hard drives at EOL.

"We" did that for a reason. Anything short of destruction means the data can be recovered if somebody has enough will.