How to wipe your hard drive securely
Posted by Kelvin on 26 Oct 2010 at 11:23 pm | Tagged as: Ubuntu
Give yourself a pat on the back if you're even thinking of doing this. Its kinda scary what people put on their hard drives, then casually dispose of them without first wiping the data clean.
Some really interesting comments from shred.c, written by Colin Plumb:
* Do a more secure overwrite of given files or devices, to make it harder * for even very expensive hardware probing to recover the data. * * Although this process is also known as "wiping", I prefer the longer * name both because I think it is more evocative of what is happening and * because a longer name conveys a more appropriate sense of deliberateness. * * For the theory behind this, see "Secure Deletion of Data from Magnetic * and Solid-State Memory", on line at * http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html * * Just for the record, reversing one or two passes of disk overwrite * is not terribly difficult with hardware help. Hook up a good-quality * digitizing oscilloscope to the output of the head preamplifier and copy * the high-res digitized data to a computer for some off-line analysis. * Read the "current" data and average all the pulses together to get an * "average" pulse on the disk. Subtract this average pulse from all of * the actual pulses and you can clearly see the "echo" of the previous * data on the disk. * * Real hard drives have to balance the cost of the media, the head, * and the read circuitry. They use better-quality media than absolutely * necessary to limit the cost of the read circuitry. By throwing that * assumption out, and the assumption that you want the data processed * as fast as the hard drive can spin, you can do better.
Anyway, for wiping, you have 2 good free options really:
1. boot into Knoppix, Ubuntu LiveCD or some other LiveCD distro and run shred
2. DBAN! (Darik's Boot and Nuke)
DBAN
Get DBAN here, burn the ISO and boot into it.
Follow instructions, and you now have a securely wiped disc. Congratulations!
NOTE
If you run into this error:
ISOLINUX 4.00 4.00pre46 ETCD Comyright (C) 1994-2010 H. Peter Anvin et al
reading sectors error(EDD)
ERROR: No configuration file found
then you've most likely downloaded DBAN 2.2.6. If this gives you this problem, try DBAN 1.0.7. Many users have reported success with 1.0.7.
Shred
The manpage for shred says:
NAME
shred – overwrite a file to hide its contents, and optionally delete itSYNOPSIS
shred [OPTIONS] FILE […]DESCRIPTION
Overwrite the specified FILE(s) repeatedly, in order to make it harder
for even very expensive hardware probing to recover the data.
To run shred, boot into a LiveCD distro (Knoppix, Ubuntu, etc), open a shell and run this:
shred -vfz -n 100 /dev/hda
Here shred is making (-n) 100 passes by overwriting the entire hard disk with (-z) zeros. And shred program (-f) forces the write by changing the permissions wherever necessary.
You may need to substitute /dev/hda for your hard drive device name. It'll be something like /dev/hda or /dev/hdb or /dev/sda etc.
If you're not sure, run
>fdisk -l > >Disk /dev/sda: 500.1 GB, 500107862016 bytes