Skip to content

Instantly share code, notes, and snippets.

@protolif
Created August 1, 2013 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protolif/6129033 to your computer and use it in GitHub Desktop.
Save protolif/6129033 to your computer and use it in GitHub Desktop.
This shell script will fill your hard drive with random bits, and then zeros. It will do this seven times. It works on UNIX, Linux, and Mac. Make sure to change /dev/sda1 to your desired drive. For the extra paranoid, run truecrypt afterwards and burn the password. Cheers!
#!/bin/bash
echo "Beginning wipe"
for i in {1..7}
do
echo "Starting pass $i..."
dd if=/dev/urandom of=/sda1 bs=1M
dd if=/dev/zero of=/sda1 bs=1M
echo "Pass $i complete."
done
echo "Wipe complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment