5

Using powershell on Win 11 could I send the password to my harddisk which is connected through and USB-SATA-Adapter?

I have a USB-SATA-Adapter for my HDD and SSD. (JMicron Tect SCSI Service) in the hardware manager on Win 11)

The HDD and SSD have a hardware password set. The HDD starts spinning when connected, but is not accessible in any way. I strongly assume it's because of the password.

Researching the internet I found there are some websites (smartmontools; USB-attached-SCSI; about hdparm; predominantly for settings and commands on Linux derivates) about this, and even an dedicated command definition, how to send data/commands from Win 11 to the USB-Device, which send the data/command as SATA command to the harddisc. The USB-Device has to support some special command, and I saw a table that those JMicron devices support it.

Sadly there is nowhere an example ordefintion to find how to send the password through this SCSI-SATA connection.

I assume it's possible by using powershell in Win 11. I also could start knoppix and most other linux systema from a USB-stick on my laptop, and would therefor also be happy with command line code/help!

Ramhound
  • 44,080
John
  • 288

2 Answers2

9

The USB-Device has to support some special command, and I saw a table that those JMicron devices support it.

That's generally for older JMicron devices. New USB-SATA adapters tend to support the standard 'SAT' pass-through method as defined in T10 "SCSI/ATA Translation".

Sadly there is nowhere an example ordefintion to find how to send the password through this SCSI-SATA connection.

On Linux, you would use the regular method with hdparm. It will automatically use the SCSI I/O functions to send the ATA commands within SCSI "ATA pass through" packets.

hdparm --security-unlock "Foo" /dev/sdc

hdparm -I /dev/sdc | sed -n /^Security/,$p

In fact it will do so even for directly SATA-connected HDDs, because Linux nowadays treats all ATA disks (even PATA ones!) as if they were SCSI disks on a special 'libata' controller, so all ATA-specific tools have learned to use SCSI ATA Passthrough when needed.

On Windows, however: I don't think you can. Although it has a similar "raw SCSI I/O" feature, I recall it being even explicitly mentioned on Microsoft's website that the OS filters the ATA 'security' commands from being sent through this facility. (It definitely performs such filtering for directly-connected ATA devices.)

So if you must do this from Windows – you'll likely need to start a Linux VM within VirtualBox and use its "USB passthrough" feature to attach the entire USB-SATA adapter to the VM, where you can run hdparm on it.

grawity
  • 501,077
2

On a Linux operating system (I used Knoppix running from a USB-stick) I first opened the filemanager to look for the name, in my case 'sdb'. Then I opened the terminal and used

hdparm --security-unlock "Password" /dev/sdb
hdparm -I /dev/sdb | sed -n /^Security/,\$p

Because I could not access the drive in the filemanager because of now a "corrupted block", I assumed it was because of the Windows Hibernation state that harddisc was on.

So I used

hdparm --security-disable "password" /dev/sdb

which I found on https://superuser.com/a/1062348/540538, to later use the harddisc without password when running Win 11 again.

I ran the first two commands with sudo in front, just because I found it that way somewhere else. The third I tried without sudo in front, which didn't work, then with sudo , and it worked then. (Obviously I have not too great knowledge about Linux. Someone might edit here and add some real knowledge here.)

I can now access the harddisc using the USB adapter when running Win 11.

There are also at least two programs for windows that could do this according to what I read. I didn't try them, as I didn't need them anymore:

  1. The smartmontools, a collection of software to use in a cmd.exe or nowadays powershell window.
  2. A programm called Victoria SSD/HDD. But I wasn't happy about that program's integrity, though it's downloadable on some reputable download sites, and declared as save.
John
  • 288