How to Write Zeros on a Hard Drive in Linux
One way to completely remove the data from a hard drive is to write zeros (0) to the entire disk. Reformatting the disk or rewriting the partition table only changes the address table; it does not remove the data. With specialized tools, the data could be recovered. However, writing zeros to the disk overwrites every byte of data with the number 0. The disk is still usable once a new partition table is created.
Instructions
-
Instructions
-
1
Download a Linux Live CD from Ubuntu.com, Opensuse.com, Knoppix.com or another site. These CDs are designed as a complete file system that runs from a CD-ROM.
-
2
Determine the name of your hard disk.
Before shutting down the original system, issue the command:
df
The name of your hard disk starts with /dev/. If you are clearing a secondary hard disk it will have an "hdb" or "sda2" name. -
-
3
Boot into the Live CD.
You will have to choose "boot from cd" during the boot-up process. -
4
Open a terminal window.
The terminal window is found under the utilities sub-menu of either the applications (GNOME) or start (KDE) menu. -
5
Type the command:
dd if=/dev/zero of=/dev/hda bs=1M
Replace "/dev/hda" with your hard drive name.
-
1
Tips & Warnings
This will destroy all data and partitions on the disk. However, the disk will still be usable after specifying new partitions.