How to securely Erase whole harddisks
There are many ways to erase your hard drive. rm can do it for you. But what if removing them is not enough, what if you need to make sure the data can not be recovered? dd can do the job quite securely.
If you need to replace a computer then you probably want to make sure the information on the hard-drive is securely erased before you deliver it to your local recycling facility.
1. How to securely erase a hard-drive
dd is a handy tool used for making copies. It can also be used to quite securely wipe harddrives:
for (( i = 0;i<10;i++ )); do
dd if=/dev/random of=dev/hda && dd if=dev/zero of=/dev/hda
done
This will overwrite your entire hard drive (in this case seen as hda by Linux) with random information ten times.
Thanks to Ritter and EnIgMa on linux-noob EFNet