-
Notifications
You must be signed in to change notification settings - Fork 0
Unlocking & Disabling ATA Lock on an ATA‐Locked Drive
You will need a password file with an exact size of 32 bytes.
For example:
yonle@yonle ~$ stat password.bin
File: password.bin
Size: 32 Blocks: 8 IO Block: 4096 regular file
Device: 0,54 Inode: 15256077 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ yonle) Gid: ( 1000/ yonle)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2026-08-11 18:11:30.375466286 +0700
Modify: 2026-08-11 18:11:29.480290027 +0700
Change: 2026-08-11 18:11:29.480290027 +0700
Birth: 2026-08-11 18:10:55.822999767 +0700
If your password is an ASCII string shorter than 32 bytes, you can create a properly sized password file with dd.
For example, assuming the drive's password is verysecret123:
printf 'verysecret123' | dd of=password.bin bs=32 count=1 conv=syncdd will pad the remaining bytes with NUL (0x00) bytes, producing a file that is exactly 32 bytes long.
Note: Change
password.binto another filename if the file already exists.
First, list the available ATA drives:
yonle@yonle ~$ sudo unlockata -device list
/dev/sda: 51CBCxxxx [TOSHIBA MK5075GSX]
/dev/sdb: 202103040xxxx [MidasForce SSD 240GB]
yonle@yonle ~$
For this example, we will unlock the MidasForce SSD 240GB.
You can identify the drive either by its serial number or by its block device.
sudo unlockata -serial 202103040xxxx -passwd password.binsudo unlockata -device /dev/sdb -passwd password.binIf successful, unlockata should not report an error:
yonle@yonle ~$ sudo unlockata -serial 2021030400273 -passwd password.bin
2021030400273 is at /dev/sdb
yonle@yonle ~$
If the password is invalid, unlockata will report a failure. For example:
yonle@yonle ~$ sudo unlockata -serial 2021030400273 -passwd password-ambatukam.bin
2021030400273 is at /dev/sdb
reread partition table: input/output error
Warning
If you lose your password, you will need the master password to erase or unlock your drive when the security level is set to high.
The master password is usually provided by, or may be obtainable from, the drive's manufacturer and model information.
If you lose both passwords, your drive is essentially a paperweight.
If the password is valid, you can permanently disable ATA Security on the drive with:
sudo unlockata -serial 2021030400273 -passwd password.bin -op disableFor example:
yonle@yonle ~$ sudo unlockata -serial 2021030400273 -passwd password.bin -op disable
2021030400273 is at /dev/sdb
yonle@yonle ~$
After the command succeeds, the ATA Security password will no longer be required to unlock the drive.