Created
July 3, 2021 17:56
-
-
Save gregjhogan/90bd89be2130a8179418223fdc4705bb to your computer and use it in GitHub Desktop.
hdparm secure erase hard drive
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
DISK_DEV=/dev/sd<?> | |
DISK_PWD="" # leave empty or set to something you will remember | |
sudo hdparm --user-master u --security-set-pass "$DISK_PWD" $DISK_DEV | |
sudo hdparm --user-master u --security-erase-enhanced "$DISK_PWD" $DISK_DEV | |
# secure erase should clear user password and disable security when complete | |
#sudo hdparm --user-master u --security-disable "$DISK_PWD" $DISK_DEV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment