Wiping old hard drives securely

TL;DR: Wipe hard drives with shred -v /dev/sda

Scenario: I want to give away my 10 year old self-built desktop computer to complete strangers for free. The hardware was actively used until around one year ago and should still be very functional with a lightweight linux distro. However, I feel somewhat paranoid about giving away my old IDE hard drives, once containing my personal stuff.

So I thought I'd fire up some trusty live image of Linux and overwrite my drives with random data. A little searching brought my to the following command:

# dd if=/dev/urandom of=/dev/sda bs=4M

Note that sda is the target hard drive (not partition) which is not mounted and bs stands for a reasonable block size for the chunks of data written per operation

/dev/urandom just like /dev/random generates random data but will also output weaker pseudo-random data once the pool of entropy (induced by external input such as mouse movement) runs out and thus should be fairly quick.

However, this operation does not emit any progress indication and I almost thought my computer just silently crashed when the process was not finished after a couple of hours. Killing the process with Ctrl + C revealed that dd was writing with 3-4Mb/s which is slow even for my ancient green label IDE drives.

Further investigation on the net brought me to use the following command:

# shred -v /dev/sda

shred is precisely designed for this kind of process and overwrites the drive with three passes of pseudo-random data. The -v flag will keep me informed about the progress. Optionally, you can add the -z flag to write all zeros after the last pass (somewhat covering the shredding operation).

On my admitably small hard drives (max. 200GB) three passes took a couple of hours, which is way too much effort and time for potentially recycling outdated hardware, but seemed like the fastest option for secure destruction.