3

I accidentally locked an HDD with an ATA password, trying to issue a secure erase command. It was on Linux, I entered this command :

# hdparm --security-erase PWD /dev/sda

So the password is PWD (no need to keep it secret as it doesn't protect anything). Fine. But now the drive is locked, the BIOS asks for the password when I boot with the drive plugged, "PWD" doesn't work, and I think I found why : the BIOS accepts only lower-case letters.

I tried to remove the drive, boot on a live USB (Fedora) and plug the HDD, but the system doesn't recognize the drive. And I can't boot with the drive plugged : the BIOS won't even let me in the setup screen to boot on the USB stick, without the ATA password.

How can I unlock it if I know the password but the BIOS doesn't accept it ?

  • 1
    Try the Live USB on another computer? – Steven Apr 6 '16 at 21:04
  • I don't have any other computer that accepts 2.5" drives. Isn't there a way to do this on this computer ? – Arno Apr 6 '16 at 21:05
  • 1
    The SATA connector will be the same for a desktop. Consider purchasing a laptop hdd enclosure or a 2.5" to 3.5" mounting bracket. – Steven Apr 6 '16 at 21:10
  • @Steven do you even really need a bracket for the 20 minutes it takes to unlock a drive? Can't you just set it in the bottom of your case? – Anonymous Penguin Feb 23 '17 at 1:45
  • You can set it on the bottom of the case. Just be careful not to inadvertently jostle the drive or touch any exposed circuitry – Steven Feb 23 '17 at 2:27
6

This is a "feature" of many BIOS implementations. Fortunately, the ATA security spec is only enforced by the BIOS, not the drive itself. That means if you can get around the BIOS, you can access the drive.

Please note, a USB enclosure may not work. Issuing ATA commands to a SATA drive in a USB enclosure may fail. It depends on whether or not the USB controller in the enclosure will reject the commands.

Here's a better way:

  1. Burn yourself a Linux Live CD or make a bootable Linux USB flash drive. There are many tools and ISOs available on the Internet for this.
  2. With the computer turned off, unhook the SATA cable from the affected hard drive.
  3. With the SATA cable disconnected, power the computer up and boot from the CD or flash drive you made in step 1.
  4. Once the system has booted, reconnect the SATA cable to the hard drive. This is called hot-plugging.
  5. IF your laptop supports SATA hot-plugging (some don't), then your hard drive will become available and you can use hdparm to remove the password from the drive.

If your laptop does not support SATA hotplugging, then this trick will have to be performed on another computer -- preferably a desktop, since desktops are usually more standards-compliant than laptops are.

Also, the SATA controller must be set to AHCI for this to work. IDE or RAID modes will fail.

  • It seemed like my laptop doesn't support hot plugging. I plugged the drive alongside the primary drive in another PC and booted it, and it was recognized. hdparm worked. I will accept your answer as it is the most complete. – Arno Apr 6 '16 at 21:46
  • It is not correct to say that ATA security is enforced by BIOS. If it were, it would be enough to simply connect a drive to another system. Yet one still has to tinker with the drive to unlock it. BIOS provides facility for contolling ATA security, but it is the drive that enforces it. – fnt Sep 5 '18 at 7:50
  • See superuser.com/a/237482/94068 for more details. – fnt Sep 5 '18 at 8:01
1

I succeeded by plugging the drive in an old PC and issuing hdparm --security-unlock PWD /dev/sdb. The drive is now reusable.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.