Last active
June 20, 2017 22:42
-
-
Save carlozt03/05aba7ece64804615d7b0528cd4be533 to your computer and use it in GitHub Desktop.
wipe_ssd.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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