How to Erase Hard Drives

From LinuxReviews
Jump to navigationJump to search

There are many ways to erase your hard drive, rm can do it for you. But what if removing them is not enough, what if you need to make sure the data can not be recovered?

Using DD

dd = disk dump is a handy tool used for making copys. It can also be used to quite securely wipe harddrives:

for (( i = 0;i<10;i++ )); do
  dd if=/dev/urandom of=/dev/hda
dd if=/dev/zero of=/dev/hda  # or /dev/sda 

This will overwrite your entire hard drive (in this case seen as hda by Linux) with random information ten times, then with zeroes once at the end.

This script will take many days or weeks to run on an average machine with a decent sized drive.

BC Wipe

The non-free (free trial) BC Wipe (manual page) from Jetico among dozens of alternatives is for securely removing single files. It supports wiping the contents of directories recursively.