Secure Erase A Drive
I am just about to reinstall Ubuntu 12.04 onto an SSD that I have been using as an extra data storage drive. Before installing the OS onto an SSD, it may be a good idea to "reset" it to peak performance by performing a Secure Erase operation.
The first thing we need to do is determine what the drive letter is of the drive we want to reset. E.g.
Use the command below to list what drives we have (ignore numbers as they represent partitions)
Use the command below to fetch all the information about a drive.
sudo hdparm -I /dev/sdX
Below is a quick way just to get the size of the drive:
sudo hdparm -I /dev/sdX | grep "device size"
Below is a quick way just to get the model of a drive:
sudo hdparm -I /dev/sdX | grep "Model Number"
Run The Erasure
Once you are confident that you know the letter of the drive that you want to erase (e.g. something like "sdc"), then we can start the erase procedure.
sudo hdparm --user-master u --security-set-pass my-password /dev/sdX
sudo hdparm --user-master u --security-erase my-password /dev/sdX
sudo hdparm -i /dev/sdX. To unfreeze a drive, you may need to reboot, or try re-plugging in the drive whilst the system is running (requires AHCI).
First published: 16th August 2018