Dan Newcome, blog

I'm bringing cyber back

Zero an old hard disk using dd

with 2 comments

Any time I get rid of a hard disk, I always overwrite the whole drive with zeroes. I know that this is not a secure practice if you are going to be selling the drive, but since the drive is going to the computer recycling center and the data isn’t a matter of national security, a quick wipe should be sufficient. If you want to resell the drive I’d recommend something like DBAN which will overwrite your data properly so that it cannot be retrieved. Practically though, zeroing a drive is enough to keep most people from retrieving the data. A drive that is on the heap with hundreds or thousands of other drives isn’t likely to be scrubbed for data anyway. I could be wrong on this, and anyone in the drive recycling business can chime in and enlighten me, but most of it probably gets shredded for scrap right?.

I use a cheap USB IDE/SATA hard drive converter to plug the old drive into my computer and then boot the computer with the Knoppix GNU/Linux distribution. Once I’m logged in, I use the following command to overwrite the whole drive with zeroes:


dd if=/dev/zero of=/dev/<drive> bs=1M

Replace <drive> with the device that represents the disk to be zeroed. Using the `dmesg’ command is helpful in determining the device name of a removable USB drive.

To check the progress we can open up another terminal window and do this:

$ while ( true ); do { kill -s USR1 <pid>; sleep 5; } done

Replace <pid> with the process ID of the dd process that is running in the other terminal window. This will cause the running `dd’ command to report its progress every 5 seconds to the terminal that it is running in.

This technique could be extended to use /dev/urandom to write random data to the drive also, but generating random data slows things down significantly on my machine and I don’t want too many more excuses standing in the way of getting rid of stuff that is taking up space in my office!

About these ads

Written by newcome

January 14, 2010 at 8:51 pm

Posted in Uncategorized

2 Responses

Subscribe to comments with RSS.

  1. Greetings! Very useful advice within this post! It’s the little changes that produce the most significant changes. Many thanks for sharing!

    hard drive sales

    June 18, 2013 at 12:42 pm

  2. […] http://newcome.wordpress.com/2010/01…disk-using-dd/ do that and it should clean the disk. then you can fdisk, format as you desire. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: