Skip to content

Preparing and Erasing an ATA Drive

Yonle edited this page Aug 11, 2026 · 1 revision

unlockata supports ATA Security Erase through two operations: erase-prepare and erase.

Caution

ATA Security Erase is destructive and may permanently destroy all data on the drive.

Make sure you have a backup before proceeding.

Prepare the drive

First, prepare the drive for the erase operation:

sudo unlockata -device /dev/sdb -op erase-prepare

Or using the drive's serial number:

sudo unlockata -serial 2021030400273 -op erase-prepare

The drive must be prepared before the erase command can be issued.

Erase the drive

The erase operation requires a valid ATA Security password. The password file must contain either the user password or master password configured on the drive.

sudo unlockata -device /dev/sdb -passwd password.bin -op erase

Or using the drive's serial number:

sudo unlockata -serial 2021030400273 -passwd password.bin -op erase

If the password is valid and the drive has been successfully prepared, the drive will begin the ATA Security Erase operation.

Warning

If you have lost the user password and cannot obtain the drive's master password, you may be unable to perform the erase or recover access to the drive.

If you lose both passwords, your drive is essentially a paperweight.

Do not proceed unless you have confirmed that you have a valid user or master password.

Caution

Do not interrupt the erase operation.

The operation may take a significant amount of time depending on the drive. Once started, the data on the drive may be unrecoverable.

Clone this wiki locally