Skip to content

Instantly share code, notes, and snippets.

@carlozt03
Last active June 20, 2017 22:42
Show Gist options
  • Save carlozt03/05aba7ece64804615d7b0528cd4be533 to your computer and use it in GitHub Desktop.
Save carlozt03/05aba7ece64804615d7b0528cd4be533 to your computer and use it in GitHub Desktop.
wipe_ssd.sh
#!/bin/bash
clear
printf "CK SSD eraser\n"
read -p "This will erase all data on this SSD. Hit enter to continue or CTRL-C to quit." enterKey
printf "\nPutting machine to sleep. Press the power button to resume..."
sleep 2
sudo pm-suspend
printf "Checking to see if SSD is unfrozen. If frozen, wipe will fail.\n"
sudo hdparm -I /dev/sda | grep frozen
printf "Setting wipe password...\n"
sudo hdparm --user-master u --security-set-pass Eins /dev/sda
read -p "Last chance to quit. Hit enter to wipe SSD!" enterKey
sudo hdparm --user-master u --security-erase-enhanced Eins /dev/sda
printf "\nSSD Wiped"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment