The officially official Devuan Forum!

You are not logged in.

#1 2024-10-18 12:58:29

VPigEePMUn7X
Member
Registered: 2024-10-08
Posts: 5  

[SOLVED] How to remove security lock from a password protected SSD

I am writing this because I've spent a lot of hours trying to figure out how to remove the password from security-locked SATA SSD. It's very useful to have information at hand when you need it.

What happened:
I was preparing a spare SSD to be installed in another PC. Wanted to wipe everything in 10 seconds using ATA command - Enhanced Secure Erase. Somehow, hdparm enhanced-secure-erase did not finish on my Crucial SSD, and left the drive in password-locked state. This is not unheard of, I read a lot of messages on internet forums with people facing the same problem like me, sometimes because of different reasons, but same problem to solve.
So, on every boot, the computer would ask to enter a password to unlock the drive. Password was empty, I just needed to press enter. The security section in my motherboard BIOS (which could apply or remove a password lock) could not get to this drive, saying that my empty password is incorrect. Crucial Storage Executive program for Windows also could do nothing about it. As I don't use Microsoft Windows at all, I wasted a lot of time at this point, trying to install Windows on another PC, tried different laptops which were incompatible with security-locked SATA drive, even tried VMs, which were incompatible with Crucial Storage Executive program, what a mess it was.

Warning: solution below will wipe all your data from the drive.

Solution (change /dev/sdc drive letter as appropriate)
Install hdparm package in your Linux. Then:

sudo hdparm -I /dev/sdc
(...)
Security: 
        Master password revision code = 65534
                supported
                enabled
                locked
                frozen
        not     expired: security count
                supported: enhanced erase

It should say on the bottom: security enabled, locked and frozen. Meaning, password is enabled, and you can't take it off, because changing of security settings is not permitted. First thing, you need to remove the frozen state. To do that, you must suspend your machine and leave it suspended for a couple of minutes. Less than one minute doesn't work, I've tried.

After you wake up the PC, check status again:

sudo hdparm -I /dev/sdc
Security: 
        Master password revision code = 65534
                supported
                enabled
                locked
        not     frozen
        not     expired: security count
                supported: enhanced erase

It should say not frozen this time.

Now you can remove the locked status:

sudo hdparm --user-master u --security-unlock "" /dev/sdc

And perform secure erase to wipe the drive completely and remove the empty password lock:

sudo hdparm --user-master u --security-erase "" /dev/sdc

When this is done, the drive will be completely blank, and all password and security settings will reset. No more password!

If you did something wrong, for example attempted security-unlock when drive is still frozen state, or security-erase when drive is still in locked and/or frozen state, you will get error like this:

sudo hdparm --user-master u --security-erase "" /dev/sdc
security_password: ""

/dev/sdc:
 Issuing SECURITY_ERASE command, password="", user=user
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 04 51 40 00 21 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 04 51 40 01 21 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

You need to sort it out before you try again, as it will not work.

Hope this helps!

Last edited by VPigEePMUn7X (2024-10-18 13:05:44)

Offline

#2 2024-10-18 16:25:18

stargate-sg1-cheyenne-mtn
Member
Registered: 2023-11-27
Posts: 172  

Re: [SOLVED] How to remove security lock from a password protected SSD

have had the same experience several times over the years.

this webpost has helpful:
https://serverfault.com/questions/712849/how-to-unlock-an-ssd-disk-with-hdparm

also see these for faq and tools:
https://www.hdat2.com/hdat2_faq.html
https://www.hdat2.com/download.html

direct download link to pdf on creating a dos usb boot thumbdrive:
https://www.hdat2.com/files/Create_DOS_USB.pdf


Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!

Offline

Board footer