-
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
NVME pass through #463
Comments
I am not sure if this is applicable to your situation, but this sounds like your drive works as an "external drive"? From arch:
On the other hand, it seems like people got things working on a PI (ASMedia 1153 family USB to SATA bridge) with a Samsung: https://forums.raspberrypi.com/viewtopic.php?t=306817. |
Hi, thanks for the info! Using the sedutil-cli against the M.2 device attached to the mainboard it works ok, but it's not very comfortable when you have to initialize several disks. Then, I was looking for a external drive to do that. I've tested several devices based in the Realtek RTL9210 and in the ASMedia ASM2362, but both are not supported in sedutil to be able to detect OPAL info and set it up. The USB to SATA is working ok, but the USB to NVMe is a little behind. Maybe is needed some reverse engineering to capture the OPAL data when is working ok attached on mainboard but the hard point is how to map this info in a ASMedia pass through command without info about the ASM2362 device. |
Please let me know if I only add noise (I know little about this stuff). I see there is a patch for linux-arm which moves opal stuff from the pci layer to core: https://lore.kernel.org/linux-arm-kernel/[email protected]/#Z31drivers:nvme:host:pci.c If you have an arm pc you could maybe see if you get different results? I am not sure if these patches have been mainlined already btw. |
Yes, the OPAL support for NVMe is already in the linux kernel and sedutil use it nicely... the problem is when you try to access this functionality through an intermediate USB to NVMe bridge. You must know how to map your request onto an ioctl the bridge (ASM2362 chip) is able to recognize and send it to the NVMe device attached... But I don't expect a lot from ASMedia to get the ASM2362 datasheet... |
I was under the impression that an unpatched kernel assumes that opal is tied to pci or sata, and that these code paths wouldn't be reached if using an usb bridge, as the kernel assumes it is talking to an usb disk. I thought the kernel patch would help in this situation, as it lifts the opal stuff from interface level to disk level. Then the interface wouldn't matter anymore (usb/pcie) I think you know more about this stuff then me however. |
Well, I've not analized the problem to the kernel level because I've got sedutil working when the NVME device is connected on the mainboard (the https://github.com/Drive-Trust-Alliance/sedutil/blob/master/linux/DtaDevLinuxNvme.cpp code path is used). When the device is attached to an enclosure with ASM2362 is detected has an SATA device and no info is showed about the device. Forcing to identify it using the code from the first message (extracted from smarttool tool) I was able to access to that information, then I guess that to get access to the rest of functionality I've to go the same way but I've not found information about it... |
EDIT: the fact that crystal disk had to tell ASM2362 to pass through nvme commands, makes me wondering how brittle this solution would be. You would rather have the kernel enumerate the disk transparantly as an nvme disk, but I guess it doesnt show up as /dev/nvmex when attached to enclosure? Hmm, I am out of my depth here. From this thread, it seems a bit of a hit and miss with adapters: https://forum.level1techs.com/t/nvme-to-usb-3-1-enclosure-buggy-in-linux-rtl9210b-chipset/199752 There are lots of drive specific quirks addressed on the pci level: torvalds/linux@107b4e0.
|
Edit 2: Some adapters seem to be working, from a quick glance: #115 |
Has anyone been able to test an adapter using PCIe Tunneling (whether it's Thunderbolt 3 or fully-featured USB4/TB4)? I just got an enclosure with the Apart from that, I've only seen SATA -> USB adapters working, but there might be NVME -> USB ones out there that work too (the ones I have don't). I also wonder if there's a difference between Windows and Linux. I personally can only test Windows (11) right now. |
I did not have problem with initialization of my Samsung 970 EVO Plus (M.2 NVMe) 1TB disk on my 12 Years old HP EliteBook 8540w, I was operating using DTA Sedutil Rescue System v.1.20 i.e. RESCUE32.img.gz from exec-1.20.0.zip or from exec-1.20.0.tar.gz that you can find under https://github.com/Drive-Trust-Alliance/exec/tags, and the SSD was connected via the AXAGON EEM2-UG2 USB-C to NVMe M.2 SSD interface. It was working well together. The rescue system was booted from USB memory Stick. |
Great! This issue has a lot of interesting info!! I'll try to get a RTL9210b adapter to test... Thank you! |
Other people already provided a lot of useful info. From my experience with SATA/USB I can only confirm that this heavily depends on the bridge used in the enclosure. Most vendors don't implement in firmware anything beyond the basic use cases. So the wisest thing is to use an enclosure/bridge already reported as working. For SATA/USB I was once advised to look at Sabrent enclosures and that worked out. |
Hi all,
Is there any possibility to have NVME pass through support implemented like for the SATA devices?
I've been trying to access to the OPAL info from a M.2 device connected through an ASMedia ASM2362 USB to NVMe bridge enclosure with no luck. After changing a little the 'DtaDevLinuxNvme::identify' method I've been able to access the information but I don't have more information to pass the NVME_SECURITY_RECV|SEND data in 'DtaDevLinuxNvme::sendCmd' embedded in a cdb structure.
To identify the device I've follow the 'https://www.smartmontools.org/ticket/1221' info.
`
void DtaDevLinuxNvme::identify(OPAL_DiskInfo& disk_info)
{
LOG(D4) << "Entering DtaDevLinuxNvme::identify()";
}`
The text was updated successfully, but these errors were encountered: