User Tools

Site Tools


Use dd to overwrite disk with zeroes, with progress information

dd is a great tool to overwrite disks quickly to erase all information on it (if you want to return them on warranty or sell them)1)

Overwrite entire disk, e.g. /dev/sdX with zeroes, for example to sell the disk or send it in for warranty. Be VERY CAREFUL as overwriting the disk will permamently destroy all data on it.

CAUTION: Only do this if you know what your are doing. Do this at your own risk!

0. DON'T do this in a hurry

1. Verify that you have a backup of all your data!

2. Locate the disk, make 100% sure by checking the size and the model!:

ls /dev/disk-by-id -l

3. Verify that you are on the right disk (check paritions):

cfdisk /dev/sdX

4. Verify that the right hd light is lighting up if you read the disk

cat /dev/sdX > /dev/null

5. Overwrite the disk with zeros:

dd if=/dev/zero of=/dev/sdX bs=4096

6. Check the progress of your running dd, from another terminal window do 2)

watch killall -USR1 dd



if you are required by law or are really paranoid, use shred, which overwrites the disk with random data, 25 times by default. But: overwriting once is enough to make the disk unrecoverable by professional data recovery services. If i had a disk with real top secret information, i would first overwrite it with shred and then physically destroy the platter
this sends the USR1 signal to all running dd instances once every second, making them print out the progress information
blog/run_dd_with_progress_information.txt · Last modified: 2011/08/23 09:01 by brb