incava.org

Erasing a Hard Drive

Problem

To erase a hard drive so that it is extremely difficult for anyone to figure out what information was on it. This may be because a computer is being donated to charity, is being sold, or is being returned to an employer.

Solution

Boot off a Linux CD and run a couple of simple utilities, which will write random data to the entire hard drive.

Nonsolution

Reformatting or "erasing" the contents of a disk. This removes record tables, but the data are in their original state. An analogy is that it is the equivalent of removing the table of contents from a book; the pages can still be read.

How To

Get a minimal version of Linux, and burn the ISO to CD. Many distributions now have such a version, such as Gentoo, available here. Look for the appropriate architecture (x86, most likely) in the section "Gentoo 2005.1 Minimal install CD".

Boot the computer off the CD. Wait while Linux recognizes the hardware and initializes.

At the command prompt, take a look at the disk, by running the command:

# fdisk -l

Example output from this:

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        5112    40957717+  83  Linux
/dev/hda3            5113        5366     2040255   82  Linux swap
/dev/hda4            5367       14593    74115877+   f  W95 Ext'd (LBA)
/dev/hda5            5367       14593    74115846   83  Linux

Erase each partition by running the shred command for each one listed, such as:

# shred -v /dev/hda1

The default number of passes -- 25 -- took roughly 4 hours on a 20 GB partition.

When complete, remove the Linux install CD from the computer, and reboot. The result should be something like "No operating system found". For once, that's a sign of success.

Valid HTML 4.01!

Valid CSS!