How to wipe a hard disk completely so that no data recovery tools can retrieve anything?

I use shred when selling old hard drives, use man shred for more information:

shred -vzn 0 /dev/xxx

You can specify n number of times to overwrite and z to overwrite it all with zeros at the end.


Modern discs implement the ATA secure erase feature, which you can do with the hdparm command using the --security-erase option, after first setting a password on the disk. Note that there are caveats, including

  • possible firmware bugs
  • possible disk controller timeout for a possibly long-running operation
  • you shouldn't do it over USB

For some discs this will take hours, as each block is rewritten. For others it can take seconds as it just means changing a global encryption key held by the disc that transparently encrypts/decrypts all data going to/from the disk. This is true for hard discs and SSDs. It's the firmware than counts.

Another article also suggests that --security-erase has the advantage that it may also wipe out the hidden areas HPA host protected area and DCO device configuration overlay.


This doesn't really answer your question, as you want to use the HDD. However, it's important.


If this is really important data that should never be recovered, it's not safe to use the disk any more. Apple Macs offer a 35 overwrite feature - which they claim is what the government requires, but it's complicated:

Effective immediately, DSS will no longer approve overwriting procedures for the sanitization or downgrading (e.g. release to lower level classified information controls) of IS storage devices (e.g., hard drives) used for classified processing.

It is thought that some of the 3-letter agencies (FBI, CIA, MI6) require physical destruction of magnetic media (e.g., melting in a furnace).

You do have a few options - the one I've relied on in the past is hitting it with a hammer lots of times, then wiping the magnets over it.

However, I'm a student and nobody wants to hack into an empty bank account, so it didn't need to be as secure. Plus, I wasn't going to bin the Hard Drive - it's now a bird scarer for the allotment.

If you work under confidentially agreements (especially those involving the government) you need something a little more secure. I'd recommend a blowtorch:

Source, CNET

My pronouns are He / Him

Tags:

Partitioning