PSID Revert tool alpha release

Kilobyte Kid

Re: PSID Revert tool alpha release

Wow, that's nice and it fits msed perfectly.  I'm learning (or tring to) blender at the moment but that's something I'll have to look at soon.

Kilobyte Kid

Re: PSID Revert tool alpha release

Hi,

I have the same problem, when i did a psid reset for the first time it worked perfectly,   when i tried to reset for the second time it doesn't work anymore.

 

I,m running on Linux with an Intel processor.

 

 

sudo ./msed -vvvvv --scan

- 10:56:26.047 DBG : Log level set to DBG4
- 10:56:26.047 DBG : Performing diskScan()
- 10:56:26.047 DBG4: Creating diskList

Scanning for Opal 2.0 compliant disks
- 10:56:26.047 DBG4: Creating MsedDev::MsedDev() /dev/sda
- 10:56:26.047 DBG4: Entering MsedDev::identify()
- 10:56:26.047 DBG4: Entering MsedBaseDev::discovery0()
- 10:56:26.047 DBG4: Entering MsedDev::sendCmd
- 10:56:26.047 DBG4: Entering MsedBaseDev::isPresent()
- 10:56:26.047 DBG4: Entering MsedBaseDev::isOpal2()
/dev/sda  No  ST500LM011 HM501II                       2AJ10001
- 10:56:26.047 DBG4: Destroying MsedDev
- 10:56:26.048 DBG4: Creating MsedDev::MsedDev() /dev/sdb
- 10:56:26.048 DBG4: Entering MsedDev::identify()
- 10:56:26.048 DBG4: Entering MsedBaseDev::discovery0()
- 10:56:26.048 DBG4: Entering MsedDev::sendCmd
- 10:56:26.048 DBG4: Entering MsedBaseDev::isPresent()
- 10:56:26.048 DBG4: Entering MsedBaseDev::isOpal2()
/dev/sdb  No  Crucial_CT256MX100SSD1                   MU01    
- 10:56:26.048 DBG4: Destroying MsedDev
- 10:56:26.048 DBG4: Creating MsedDev::MsedDev() /dev/sdc
- 10:56:26.048 DBG4: Entering MsedDev::identify()
- 10:56:26.048 ERR : Identify failed Invalid argument
- 10:56:26.048 DBG4: Entering MsedBaseDev::isPresent()
- 10:56:26.048 DBG4: Entering MsedBaseDev::isOpal2()
/dev/sdc  No   
- 10:56:26.048 DBG4: Destroying MsedDev
- 10:56:26.048 DBG4: Creating MsedDev::MsedDev() /dev/sdd
- 10:56:26.048 DBG1: Error opening device /dev/sdd -1
- 10:56:26.048 DBG4: Entering MsedBaseDev::isPresent()
- 10:56:26.048 DBG4: Destroying MsedDev
No more disks present ending scan
 
sudo ./msed -vvvvv --query /dev/sdb
- 11:00:09.054 DBG : Log level set to DBG4
- 11:00:09.054 DBG : Performing diskquery() on /dev/sdb
- 11:00:09.054 DBG4: Entering diskQuery()/dev/sdb
- 11:00:09.054 DBG4: Creating MsedDev::MsedDev() /dev/sdb
- 11:00:09.054 DBG4: Entering MsedDev::identify()
- 11:00:09.054 DBG4: Entering MsedBaseDev::discovery0()
- 11:00:09.055 DBG4: Entering MsedDev::sendCmd
- 11:00:09.055 DBG4: Entering MsedBaseDev::isPresent()
- 11:00:09.055 DBG4: Entering MsedBaseDev::isOpal2()
- 11:00:09.055 ERR : Device not Opal2 /dev/sdb
- 11:00:09.055 DBG4: Destroying MsedDev

JEDEC Jedi

Re: PSID Revert tool alpha release

leander, are you sure the drive is locked in TCG Opal mode? I am not sure but I think Revert procedure doesn't work if the drive is in standard ATA Security feature Set.

______________________________________

FAQs and Top Forum Solutions
Did a user help you? Say thanks by giving Kudos!
How do I know what memory to buy?
Still need help? Contact Crucial Customer Service
Remember to regularly backup your important data!

Kilobyte Kid

Re: PSID Revert tool alpha release

Did you remember to set the allow_tpm kernel flag?

What does "cat /sys/module/libata/parameters/allow_tpm" produce a "1" or a "0"?

If it's a "0" try these commands (from the linux readme):

sudo chmod 0744 /sys/module/libata/parameters/allow_tpm
sudo echo "1" > /sys/module/libata/parameters/allow_tpm

Kilobyte Kid

Re: PSID Revert tool alpha release

Thank you for your answer. This command does the trick. Now is my ssd listed as an compatible device.
Kilobyte Kid

Re: PSID Revert tool alpha release

I really appreciate your developing this tool.  Thanks for the latest updates for 64 bit.

 

I'm curious as to your background - how did you learn to write such a tool? To do this requires a fair bit of experience with low level drive control, and the Opal info is not well documented. I had thought you have to be a member of the Opal TCG group to get details.

 

I tried using the 64 bit tool to do a psid reset on a Toshiba Opan 2 drive, model MQ01ABU032W. It did not work.  I tried using it on a Curcial M600 and it seemed to work OK, so I think the problem is specific to the Toshiba.

 

I noticed that the  output differed a bit from what was in the instructions. When using the --scan option, instead of outputting "Yes", the output seems to give the Opal version supported (1, 2, or No). I tried using it on a Seagate Opal 1 drive and msed64 gave "1" instead of "2".

 

I booted from WinPE 5, 64 bit.

 

Here is what results from using "msed64 --scan":

Scanning for Opal 2.0 compliant disks
\\.\PhysicalDrive0  2  TOSHIBA MQ01ABU032W                      FN001S  
\\.\PhysicalDrive1 No                                                   
No more disks present ending scan

 

Here is what results from using "msed64 --query \\.\PhysicalDevice0

 

\\.\\PhysicalDrive0 ATA TOSHIBA MQ01ABU032W                      FN001S            24LAWWBHT
TPer function (0x0001)
    ACKNAK = N, ASYNC = N. BufferManagement = N, comIDManagement  = N, Streaming = Y, SYNC = Y
Locking function (0x0002)
    Locked = N, LockingEnabled = Y, LockingSupported = Y, MBRDone = N, MBREnabled = N, MediaEncrypt = Y
Geometry function (0x0003)
    Align = Y, Alignment Granularity = 1 (512), Logical Block size = 512, Lowest Aligned LBA = 0
SingleUser function (0x0201)
    ALL = Y, ANY = Y, Policy = N, Locking Objects = 9
DataStore function (0x0202)
    Max Tables = 10, Max Size Tables = 10485760, Table size alignment = 4096
OPAL 2.0 function (0x0203)
    Base comID = 0x2000, Initial PIN = 0x0 , Reverted PIN = 0x0 , comIDs = 1
    Locking Admins = 4, Locking Users = 9, Range Crossing = N

 

Here is what results from using "msed64 -vvvvv --query \\.\PhysicalDevice0

 

- 12:18:48.000 DBG : Log level set to DBG4
- 12:18:48.000 DBG : Performing diskquery() on \\.\\PhysicalDrive0
- 12:18:48.000 DBG4: Entering diskQuery()\\.\\PhysicalDrive0
- 12:18:48.000 DBG4: Creating MsedDev::Mseddev() \\.\\PhysicalDrive0
- 12:18:48.000 DBG4: Entering MsedDev::identify()
- 12:18:48.000 DBG4: Entering MsedDev::sendCmd
- 12:18:48.000 DBG4: Entering MsedBaseDev::discovery0()
- 12:18:48.000 DBG4: Entering MsedDev::sendCmd
- 12:18:48.015 DBG3: Dumping D0Response
- 12:18:48.015 DBG4: Entering hexDump
0000 000000a0 00000001 00000000 00000000  ................
0010 30303032 202d2054 6f736869 62612030  0002 - Toshiba 0
0020 322f3031 2f323031 33203132 3a303000  2/01/2013 12:00.
0030 0001100c 11000000 00000000 00000000  ................
0040 0002100c 0b000000 00000000 00000000  ................
0050 0003101c 01000000 00000000 00000200  ................
0060 00000000 00000001 00000000 00000000  ................
0070 02031010 20000001 00000400 09000000  .... ...........
0080 00000000 0201100c 00000009 03000000  ................
0090 00000000 0202100c 0000000a 00a00000  ................
- 12:18:48.015 DBG4: Entering MsedBaseDev::isPresent()
- 12:18:48.015 DBG4: Entering MsedBaseDev::isANYSSC
- 12:18:48.015 DBG4: Entering MsedBaseDev:Smiley Tongueuke()

\\.\\PhysicalDrive0 ATA TOSHIBA MQ01ABU032W                      FN001S            24LAWWBHT
TPer function (0x0001)
    ACKNAK = N, ASYNC = N. BufferManagement = N, comIDManagement  = N, Streaming = Y, SYNC = Y
Locking function (0x0002)
    Locked = N, LockingEnabled = Y, LockingSupported = Y, MBRDone = N, MBREnabled = N, MediaEncrypt = Y
Geometry function (0x0003)
    Align = Y, Alignment Granularity = 1 (512), Logical Block size = 512, Lowest Aligned LBA = 0
SingleUser function (0x0201)
    ALL = Y, ANY = Y, Policy = N, Locking Objects = 9
DataStore function (0x0202)
    Max Tables = 10, Max Size Tables = 10485760, Table size alignment = 4096
OPAL 2.0 function (0x0203)
    Base comID = 0x2000, Initial PIN = 0x0 , Reverted PIN = 0x0 , comIDs = 1
    Locking Admins = 4, Locking Users = 9, Range Crossing = N
- 12:18:48.015 DBG4: Destroying TCGdev

 

 

Here is what results from using "msed --yesIreallywanttoERASE*ALL*mydatausingthePSID <psid value> \\.\PhysicalDevice0

 

- 12:12:01.000 ERR : Method Status missing
- 12:12:01.000 ERR : Session start failed
- 12:12:01.047 ERR : One or more header fields have 0 length
- 12:12:01.047 ERR : EndSession Failed

 

 

Here is what results from using "msed -vvvvv --yesIreallywanttoERASE*ALL*mydatausingthePSID <psid value> \\.\PhysicalDevice0

 

 - 12:12:58.000 DBG : Log level set to DBG4
- 12:12:58.000 DBG : Performing a PSID Revert on \\.\PhysicalDrive0 with password <psid value>
- 12:12:58.000 DBG4: Entering revertTPer(char * devref, char * password)
- 12:12:58.000 DBG4: Creating MsedDev::Mseddev() \\.\PhysicalDrive0
- 12:12:58.000 DBG4: Entering MsedDev::identify()
- 12:12:58.015 DBG4: Entering MsedDev::sendCmd
- 12:12:58.015 DBG4: Entering MsedBaseDev::discovery0()
- 12:12:58.015 DBG4: Entering MsedDev::sendCmd
- 12:12:58.015 DBG3: Dumping D0Response
- 12:12:58.015 DBG4: Entering hexDump
0000 000000a0 00000001 00000000 00000000  ................
0010 30303032 202d2054 6f736869 62612030  0002 - Toshiba 0
0020 322f3031 2f323031 33203132 3a303000  2/01/2013 12:00.
0030 0001100c 11000000 00000000 00000000  ................
0040 0002100c 0b000000 00000000 00000000  ................
0050 0003101c 01000000 00000000 00000200  ................
0060 00000000 00000001 00000000 00000000  ................
0070 02031010 20000001 00000400 09000000  .... ...........
0080 00000000 0201100c 00000009 03000000  ................
0090 00000000 0202100c 0000000a 00a00000  ................
- 12:12:58.015 DBG4: Entering MsedBaseDev::isOpal2()
- 12:12:58.015 DBG4: Creating MsedCommand()
- 12:12:58.015 DBG4: Creating MsedSsession()
- 12:12:58.015 DBG4: Creating  MsedResponse()
- 12:12:58.015 DBG4: Entering MsedSession::setProtocol
- 12:12:58.015 DBG4: Entering MsedSession::startSession
- 12:12:58.015 DBG4: Creating MsedCommand()
- 12:12:58.015 DBG4: Creating  MsedResponse()
- 12:12:58.031 DBG4: Entering MsedCommand::reset(InvokingUid, method)
- 12:12:58.031 DBG4: Entering MsedCommand::reset()
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(uint64_t number)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_UID token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TINY_ATOM token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TINY_ATOM token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(const char * bytestring)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TINY_ATOM token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_UID token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.031 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.031 DBG4: Entering MsedCommand::complete(uint8_t EOD)
- 12:12:58.031 DBG4: Entering MsedSession::sendCommand()
- 12:12:58.031 DBG4: Entering MsedCommand::setHSN()
- 12:12:58.031 DBG4: Entering MsedCommand::setTSN()
- 12:12:58.031 DBG4: Entering MsedBaseDev::comID()
- 12:12:58.031 DBG4: Entering MsedCommand::setcomID()
- 12:12:58.031 DBG3:
Dumping command buffer
- 12:12:58.031 DBG4: Entering hexDump
0000 00000000 20000000 00000000 00000000  .... ...........
0010 0000007c 00000000 00000000 00000000  ...|............
0020 00000000 00000000 00000064 00000000  ...........d....
0030 00000000 00000058 f8a80000 00000000  .......X........
0040 00ffa800 00000000 00ff02f0 8169a800  .............i..
0050 00020500 00000101 f200d020 56534755  ........... VSGU
0060 53375547 3336584e 51555650 54365757  S7UG36XNQUVPT6WW
0070 36585947 50473144 41473559 f3f203a8  6XYGPG1DAG5Y....
0080 00000009 0001ff01 f3f1f9f0 000000f1  ................
- 12:12:58.031 DBG4: Entering MsedBaseDev::comID()
- 12:12:58.031 DBG4: Entering MsedDev::sendCmd
- 12:12:58.156 DBG4: Entering MsedBaseDev::comID()
- 12:12:58.156 DBG4: Entering MsedDev::sendCmd
- 12:12:58.156 DBG3:
Dumping reply buffer
- 12:12:58.156 DBG4: Entering hexDump
0000 00000000 20000000 00000000 00000000  .... ...........
0010 00000048 00000000 00000000 00000000  ...H............
0020 00000000 00000000 00000030 00000000  ...........0....
0030 00000000 00000024 f8a80000 00000000  .......$........
0040 00ffa800 00000000 00ff03f0 816984d0  .............i..
0050 0b907bf1 f9f00000 00f1ffff           ..{.........
- 12:12:58.156 DBG4: Entering  MsedResponse::init
- 12:12:58.156 DBG4: Entering  MsedResponse::getTokenCount()
- 12:12:58.156 DBG4: Entering  MsedResponse::tokenIs
- 12:12:58.156 ERR : Method Status missing
- 12:12:58.156 ERR : Session start failed
- 12:12:58.156 DBG4: Destroying MsedCommand
- 12:12:58.156 DBG4: Destroying MsedResponse
- 12:12:58.156 DBG4: Destroying MsedCommand
- 12:12:58.156 DBG4: Destroying MsedSession
- 12:12:58.156 DBG4: Creating  MsedResponse()
- 12:12:58.156 DBG4: Creating MsedCommand()
- 12:12:58.156 DBG4: Entering MsedCommand::reset()
- 12:12:58.156 DBG4: Entering MsedCommand::addToken(OPAL_TOKEN token)
- 12:12:58.156 DBG4: Entering MsedCommand::complete(uint8_t EOD)
- 12:12:58.156 DBG4: Entering MsedSession::sendCommand()
- 12:12:58.172 DBG4: Entering MsedCommand::setHSN()
- 12:12:58.172 DBG4: Entering MsedCommand::setTSN()
- 12:12:58.172 DBG4: Entering MsedBaseDev::comID()
- 12:12:58.172 DBG4: Entering MsedCommand::setcomID()
- 12:12:58.172 DBG3:
Dumping command buffer
- 12:12:58.172 DBG4: Entering hexDump
0000 00000000 20000000 00000000 00000000  .... ...........
0010 00000028 00000000 00000000 00000000  ...(............
0020 00000000 00000000 00000010 00000000  ................
0030 00000000 00000001 fa000000           ............
- 12:12:58.172 DBG4: Entering MsedBaseDev::comID()
- 12:12:58.172 DBG4: Entering MsedDev::sendCmd
- 12:12:58.219 DBG4: Entering MsedBaseDev::comID()
- 12:12:58.219 DBG4: Entering MsedDev::sendCmd
- 12:12:58.219 DBG3:
Dumping reply buffer
- 12:12:58.219 DBG4: Entering hexDump
0000 00000000 20000000 00000000 00000000  .... ...........
0010 00000000                             ....
- 12:12:58.219 DBG4: Entering  MsedResponse::init
- 12:12:58.219 ERR : One or more header fields have 0 length
- 12:12:58.219 ERR : EndSession Failed
- 12:12:58.219 DBG4: Destroying MsedCommand
- 12:12:58.219 DBG4: Destroying MsedResponse
- 12:12:58.219 DBG4: Destroying TCGdev
- 12:12:58.219 DBG4: Destroying MsedResponse

 

I would appreciate any help you could give. I'm trying to erase the Toshiba drive because after trying Bitlocker on Win 8.1, then trying to load Win 8 on it for a test, the drive would no longer allow partitions to be created on it. I had thought I had turned off Bitlocker before putting on te second OS. I'm hoping if I do a psid reset, the drive will respond correctly again.

 

Thanks much.

 

 

 

Kilobyte Kid

Re: PSID Revert tool alpha release

You're welcome for the tool, sorry it's not working on your drive. 

 

Yes, the scan output is a little different, I changed it when I added the latest support for querying OPAL 1.0 and Enterprise class drives.  It may change yet again, that's the nice thing about calling your software alpha/beta you can change things and if someone doesn't like it you can say "well it's beta".

 

I've been coding since before dinosaurs roamed the earth, My background is in enterprise class (system Z) operating systems installation, maintenece and tuning.  I learned C and smaller systems as a hobby/time-sink by reading and doing. 

 

The TCG specs are "open" and available on the TCG web site. but they are written in the dense mind numbing lexicon of all standards, you just have to make sure to stop reading it before your brain turns to mush.

 

Your drive isn't correctly implementing the OPAL 2.0 spec, this isn't unusual, every drives firmware has it's quirks, Micron/Crucial, Samsung and Segate have issues as well.  The reply to the start session command is borked up pretty badly.  The length descriptor of the reply includes the padding and the padding is x'ff' instead of x'00'.  When I parse this I can't find the method response field so I dont know that the session has started and can't proceed with the PSIDRevert command.

 

So how about this:

You check for a firmware update for the drive, a quick google didn't look promising :-(

I'll look into how bad the code to work around this would look.

Kilobyte Kid

Re: PSID Revert tool alpha release

I am trying to revive my mx100 with your msed.

How should I install msed into Parted Magic 2014_11_19?

Kilobyte Kid

Re: PSID Revert tool alpha release

It's been a long time since I used PMagic, but if I remember correctly it's an initrd image that runs from memory. All you should need to do is put msed somewhere you can cd to after the boot. If you have created a usb stick to boot PMagic just copy msed to the stick and after you boot mount the stick, cd to the mount point and run msed from there.

Kilobyte Kid

Re: PSID Revert tool alpha release

r0m30
Thank you for your reply. I really appreciate your guidance.
I copied msed and .sh files onto PMagic desktop and run it msed --scan from there.
But my mx100 512gb is still asleep like a sleeping beauty. uefi or bios cannot detect it