Wiping a Hard Drive Clean

To securely wipe a hard drive of all data, do:

apt install wipe
shred -vfz -n 2 /dev/sdb
  • Options above are verbose, force, zero out in an extra pass
  • Number of passes: -n 2

An alternative “light” way of doing this is to simply copy random bytes

D=sdb
fdisk -l /dev/$D # make sure we have the right device
dd if=/dev/urandom of=/dev/$D bs=4096 status=progress
  • If the progress info is not sufficient, then from another terminal session do the following and updates will appear in the original terminal
pgrep -l '^dd$'   # gives the pid: nnnn DD
watch -n 60 kill -USR1 nnnn # sends a USR1 every 60 seconds