This post describes how to wipe hard drive data with the “dd” command. From here and here.
1 2 3 4 5 6 7 8 9
# Write zero to "/dev/sdb" device. ddif=/dev/zero of=/dev/sdb bs=1M # Write random numbers to "/dev/sdb" device. ddif=/dev/urandom of=/dev/sdb bs=1M # Wiping the Master boot record (MBR). ddif=/dev/zero of=/dev/hdb bs=446 count=1 # Wiping partition. ddif=/dev/zero of=/dev/sdb2 bs=1M ddif=/dev/urandom of=/dev/sdb3 bs=1M
An insteresting point is why writing random nubmer is better than zero.
Writing more than once is even more securer.
wipeIt.sh
1 2 3 4
#!/bin/bash # Save the script as a file "wipeIt.sh" and add execution permission to it: # chmod a+x wipeIt.sh for n in `seq 7`; doddif=/dev/urandom of=/dev/sdb bs=8b conv=notrunc; done