Skip to content

Instantly share code, notes, and snippets.

@tkoz0
Created March 29, 2021 11:17
Show Gist options
  • Save tkoz0/001d0cf1bc4b58e43d82ee3d40e91bfb to your computer and use it in GitHub Desktop.
Save tkoz0/001d0cf1bc4b58e43d82ee3d40e91bfb to your computer and use it in GitHub Desktop.
Commands to securely erase a SSD. Based on some article, may have issues with SSD being locked/frozen
#!/bin/bash
# $1 = ssd block device (such as /dev/sda)
sudo hdparm -I $1
sudo hdparm --user-master u --security-set-pass p $1
sudo hdparm --user-master u --security-erase p $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment