-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow read-only mode on Linux for ATA drives #437
base: master
Are you sure you want to change the base?
Conversation
@fpoliakov Thanks for the PR. I had a similar issue with the same disk. But still when I did:
When I replugged the disk I'm able to unlock it:
But it's mounted as read-only.
I've tried invoking partprobe, hdparm -Z, etc and it doesn't help. How do you unlock the device? Thanks! Edit: the only workaround I've found is (but it requires to suspend the laptop):
To find the 6-1 magic number I've used following script:
Edit2: I've managed to put the SSD into suspend state and then wake it - it also properly unlocks the device. Script that I'm using to unlock it (
|
@dobo90 Wow, I'm surprised someone found this report so quickly :) Thanks for your follow-up; personally I stopped after stumbling upon the very same problem that even when unlocked, disk isn't remounted in RW mode so it's impossible to do anything with it. I was fine with it being unbricked. I'll try your script a little later & report back. Btw, even after the SSD was PSID reverted, samsung magician reports it in a somewhat broken way and doesn't allow it to enable it's built-in encryption. I also noticed than on my other T7 after enabling encryption via magician, sedutil reports it as Opal-locked, so in principle it should be possible to either understand how magician enables the opal encryption without (almost)bricking the device or understand how it derives/hashes the password to be able to unlock it via sedutil, but didn't have a chance to look into it yet. |
Hey @fpoliakov, an alternative to using OPAL is to configure biometric credentials on T7 Touch… once unlocked using fingerprint, drive behaves like a regular drive while being self-encrypted. |
Background:
I was experimenting with portable T7 SSD from Samsung. I wanted to have an encrypted drive on my RPi, and the only viable way forward (given that RPi doesn't have HW crypto exts) was OPAL - compatible ssd. I successfully compiled sedutil, was really surprised when it recognized T7 as Opal 2.0-compatible SSD. Afterwards, I was able to make it work using the regular set of commands to set up Opal (I needed to erase using PSID first before I could set up Opal for the first time though).
After I rebooted though, sedutil stopped to recognize the SSD as Opal-compatible and returned 0 for status.
I spent the next several hours trying to do literally everything to unlock it, including hdparm, requesting factory reset tool from Samsung to no avail. I then tried to debug sedutil, and it turned out it failed because it wasn't able to open device in RDWR mode, but it was operating totally fine & getting device properties correctly opening it just in readonly mode.
I know that my patch right now might open the door for some other issues / data loss, so I'm fine with making the changes for --scan allowing read-only and warning about it, and any other command requiring some special flag like
--yesidowanttoallowreadonly
.In case if anyone's wondering, I was able to successfully work with T7 USB SSD both via RPi 4b nad via Ubuntu/VMWare (on top of Windows). Running pure Ubuntu was encountering the same issue with vanilla sedutil; vanill sedutil didn't recognize T7 as Opal-based SSD on Windows even in unlocked state.
Any Samsung tools on any OS were not able to recognize / unlock the device.