Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === Low Level Secure Erase of HDD (helps to wipe data and fix bad blocks) ===
- !!!VERY IMPORTANT!!! Double check the path to hard drive which you want to wipe,
- otherwise your data will be fucked up. Be very careful, use at your own risk!!!
- This script requires pv (for monitoring the progress) and openssl (for fast random number generation)
- In my case - Ubuntu LiveCD 14.10 (Utopic) - openssl was already preinstalled,
- but I had download the latest pv package from Launchpad: (couldnt install through apt-get)
- http://launchpad.net/ubuntu/utopic/amd64/pv/
- Create script.sh , copy-paste the text below (and edit it, to add passes and insert your drive letter)
- and make this script executable by running chmod. Then go to sudo su - of course you need to be root
- P.S. "|| true" is needed, so that script will not quit after "ran out of space" warning
- (happens at the end of pass, when "dd" already erased your disk and just can't write more)
- --------------------------------------------------------------------------------------
- echo "PASS 1: dd if=<(openssl enc -aes-256-ctr -pass pass:\"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)\" -nosalt < /dev/zero) iflag=nocache bs=4096 | pv | dd of=/dev/sdXXXXX oflag=direct bs=4096 || true"
- dd if=<(openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero) iflag=nocache bs=4096 | pv | dd of=/dev/sdXXXXX oflag=direct bs=4096 || true
- echo "PASS 2: dd if=<(openssl enc -aes-256-ctr -pass pass:\"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)\" -nosalt < /dev/zero) iflag=nocache bs=4096 | pv | dd of=/dev/sdXXXXX oflag=direct bs=4096 || true"
- dd if=<(openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero) iflag=nocache bs=4096 | pv | dd of=/dev/sdXXXXX oflag=direct bs=4096 || true
- echo "PASS 3: dd if=/dev/zero iflag=nocache bs=4096 | pv | dd of=/dev/sdXXXXX oflag=direct bs=4096 || true"
- dd if=/dev/zero iflag=nocache bs=4096 | pv | dd of=/dev/sdXXXXX oflag=direct bs=4096 || true
Add Comment
Please, Sign In to add comment