Opened 5 months ago

Closed 5 months ago

Last modified 3 months ago

#1403 closed enhancement (duplicate)

NVMe pass-through support for Samsung T7 SSD (0x04e8:0x4001)

Reported by: Sylvain Miossec Owned by:
Priority: minor Milestone: Release 7.3
Component: all Version: 7.1
Keywords: nvme usb Cc:

Description

I tried to get info of Samsung T7 external SSD, but got this error (I had to specify -d scsi by trial and error otherwise got error)

$ sudo smartctl -a -d scsi /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-gentoo] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               Samsung
Product:              PSSD T7
Revision:             0
Compliance:           SPC-4
User Capacity:        1 000 204 886 016 bytes [1,00 TB]
Logical block size:   512 bytes
LU is fully provisioned
Rotation Rate:        Solid State Device
Logical Unit id:      0x5000000000000001
Serial number:        Z369004N0KN1T5S
Device type:          disk
Local Time is:        Mon Nov 30 09:13:44 2020 CET
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging

Attachments (2)

smartctl_debug.txt (6.9 KB) - added by Sylvain Miossec 5 months ago.
Also attached is with debug info with command sudo smartctl -x -d scsi /dev/sda2 -r ioctl,2 > smartctl_debug.txt
smartctl_debug.2.txt (7.2 KB) - added by Sylvain Miossec 5 months ago.
sudo smartctl -x /dev/sda2 -r ioctl,2 > smartctl_debug.txt

Download all attachments as: .zip

Change History (19)

Changed 5 months ago by Sylvain Miossec

Attachment: smartctl_debug.txt added

Also attached is with debug info with command sudo smartctl -x -d scsi /dev/sda2 -r ioctl,2 > smartctl_debug.txt

comment:1 Changed 5 months ago by Sylvain Miossec

I forgot to say I updated the database

comment:2 Changed 5 months ago by Christian Franke

Milestone: undecided

USB-Id?
Error message of smartctl if no -d option is specified?
Error message of smartctl if -d sat option is specified?

Is Linux UAS transfer mode enabled?
If yes, then this ticket is another duplicate of ticket #971.

comment:3 Changed 5 months ago by Sylvain Miossec

UAS transfer was not enabled. I added it and get same problem. I also added support for usb-c, as it is connected to usb-c port.

Without -d option I get

$ sudo smartctl -a /dev/sda
Password: 
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-gentoo] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sda: Unknown USB bridge [0x04e8:0x4001 (0x100)]
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

With -d sat I get

$ sudo smartctl -a /dev/sg0 -d sat
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-gentoo] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: scsi error unsupported scsi opcode

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

And kernel message when connecting (not sure how far I had to go)

[  167.771774] pci 0000:03:00.0: [8086:15da] type 01 class 0x060400
[  167.771832] pci 0000:03:00.0: enabling Extended Tags
[  167.771907] pci 0000:03:00.0: supports D1 D2
[  167.771908] pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[  167.772148] pci 0000:04:00.0: [8086:15da] type 01 class 0x060400
[  167.772213] pci 0000:04:00.0: enabling Extended Tags
[  167.772300] pci 0000:04:00.0: supports D1 D2
[  167.772302] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[  167.772407] pci 0000:04:01.0: [8086:15da] type 01 class 0x060400
[  167.772479] pci 0000:04:01.0: enabling Extended Tags
[  167.772567] pci 0000:04:01.0: supports D1 D2
[  167.772568] pci 0000:04:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[  167.772675] pci 0000:04:02.0: [8086:15da] type 01 class 0x060400
[  167.772738] pci 0000:04:02.0: enabling Extended Tags
[  167.772823] pci 0000:04:02.0: supports D1 D2
[  167.772824] pci 0000:04:02.0: PME# supported from D0 D1 D2 D3hot D3cold
[  167.772948] pci 0000:03:00.0: PCI bridge to [bus 04-3b]
[  167.772958] pci 0000:03:00.0:   bridge window [mem 0xd4000000-0xea0fffff]
[  167.772964] pci 0000:03:00.0:   bridge window [mem 0xb0000000-0xd1ffffff 64bit pref]
[  167.773010] pci 0000:04:00.0: PCI bridge to [bus 05]
[  167.773019] pci 0000:04:00.0:   bridge window [mem 0xea000000-0xea0fffff]
[  167.773068] pci 0000:04:01.0: PCI bridge to [bus 06-3a]
[  167.773077] pci 0000:04:01.0:   bridge window [mem 0xd4000000-0xe9efffff]
[  167.773083] pci 0000:04:01.0:   bridge window [mem 0xb0000000-0xd1ffffff 64bit pref]
[  167.773150] pci 0000:3b:00.0: [8086:15db] type 00 class 0x0c0330
[  167.773185] pci 0000:3b:00.0: reg 0x10: [mem 0xe9f00000-0xe9f0ffff]
[  167.773263] pci 0000:3b:00.0: enabling Extended Tags
[  167.773372] pci 0000:3b:00.0: supports D1 D2
[  167.773373] pci 0000:3b:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[  167.773416] pci 0000:3b:00.0: 8.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x4 link at 0000:04:02.0 (capable of 31.504 Gb/s with 8 GT/s x4 link)
[  167.773548] pci 0000:04:02.0: PCI bridge to [bus 3b]
[  167.773556] pci 0000:04:02.0:   bridge window [mem 0xe9f00000-0xe9ffffff]
[  167.773585] pci_bus 0000:04: Allocating resources
[  167.773600] pci 0000:04:01.0: bridge window [io  0x1000-0x0fff] to [bus 06-3a] add_size 1000
[  167.773602] pci 0000:04:02.0: bridge window [io  0x1000-0x0fff] to [bus 3b] add_size 1000
[  167.773605] pci 0000:04:02.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 3b] add_size 200000 add_align 100000
[  167.773607] pci 0000:03:00.0: bridge window [io  0x1000-0x0fff] to [bus 04-3b] add_size 3000
[  167.773610] pci 0000:03:00.0: BAR 7: assigned [io  0x2000-0x4fff]
[  167.773614] pci 0000:04:02.0: BAR 9: no space for [mem size 0x00200000 64bit pref]
[  167.773616] pci 0000:04:02.0: BAR 9: failed to assign [mem size 0x00200000 64bit pref]
[  167.773618] pci 0000:04:01.0: BAR 7: assigned [io  0x2000-0x2fff]
[  167.773620] pci 0000:04:02.0: BAR 7: assigned [io  0x3000-0x3fff]
[  167.773623] pci 0000:04:02.0: BAR 9: no space for [mem size 0x00200000 64bit pref]
[  167.773624] pci 0000:04:02.0: BAR 9: failed to assign [mem size 0x00200000 64bit pref]
[  167.773626] pci 0000:04:00.0: PCI bridge to [bus 05]
[  167.773631] pci 0000:04:00.0:   bridge window [mem 0xea000000-0xea0fffff]
[  167.773640] pci 0000:04:01.0: PCI bridge to [bus 06-3a]
[  167.773643] pci 0000:04:01.0:   bridge window [io  0x2000-0x2fff]
[  167.773647] pci 0000:04:01.0:   bridge window [mem 0xd4000000-0xe9efffff]
[  167.773652] pci 0000:04:01.0:   bridge window [mem 0xb0000000-0xd1ffffff 64bit pref]
[  167.773658] pci 0000:04:02.0: PCI bridge to [bus 3b]
[  167.773661] pci 0000:04:02.0:   bridge window [io  0x3000-0x3fff]
[  167.773666] pci 0000:04:02.0:   bridge window [mem 0xe9f00000-0xe9ffffff]
[  167.773674] pci 0000:03:00.0: PCI bridge to [bus 04-3b]
[  167.773677] pci 0000:03:00.0:   bridge window [io  0x2000-0x4fff]
[  167.773682] pci 0000:03:00.0:   bridge window [mem 0xd4000000-0xea0fffff]
[  167.773686] pci 0000:03:00.0:   bridge window [mem 0xb0000000-0xd1ffffff 64bit pref]
[  167.773768] pcieport 0000:03:00.0: enabling device (0006 -> 0007)
[  167.774138] pcieport 0000:04:01.0: enabling device (0006 -> 0007)
[  167.774318] pcieport 0000:04:02.0: enabling device (0006 -> 0007)
[  167.774676] xhci_hcd 0000:3b:00.0: xHCI Host Controller
[  167.775421] xhci_hcd 0000:3b:00.0: new USB bus registered, assigned bus number 3
[  167.776541] xhci_hcd 0000:3b:00.0: hcc params 0x200077c1 hci version 0x110 quirks 0x0000000200009810
[  167.776883] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[  167.776885] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[  167.776887] usb usb3: Product: xHCI Host Controller
[  167.776889] usb usb3: Manufacturer: Linux 5.4.72-gentoo xhci-hcd
[  167.776890] usb usb3: SerialNumber: 0000:3b:00.0
[  167.777092] hub 3-0:1.0: USB hub found
[  167.777193] hub 3-0:1.0: 2 ports detected
[  167.777528] xhci_hcd 0000:3b:00.0: xHCI Host Controller
[  167.777862] xhci_hcd 0000:3b:00.0: new USB bus registered, assigned bus number 4
[  167.777866] xhci_hcd 0000:3b:00.0: Host supports USB 3.1 Enhanced SuperSpeed
[  167.777984] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.04
[  167.777986] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[  167.777987] usb usb4: Product: xHCI Host Controller
[  167.777989] usb usb4: Manufacturer: Linux 5.4.72-gentoo xhci-hcd
[  167.777990] usb usb4: SerialNumber: 0000:3b:00.0
[  167.778171] hub 4-0:1.0: USB hub found
[  167.778271] hub 4-0:1.0: 2 ports detected
[  168.204544] usb 4-1: new SuperSpeedPlus Gen 2 USB device number 2 using xhci_hcd
[  168.216971] usb 4-1: New USB device found, idVendor=04e8, idProduct=4001, bcdDevice= 1.00
[  168.216975] usb 4-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[  168.216977] usb 4-1: Product: PSSD T7
[  168.216978] usb 4-1: Manufacturer: Samsung
[  168.216979] usb 4-1: SerialNumber: S5T1NK0N400963Z
[  168.221216] scsi host8: uas
[  168.222015] scsi 8:0:0:0: Direct-Access     Samsung  PSSD T7          0    PQ: 0 ANSI: 6
[  168.223026] sd 8:0:0:0: Attached scsi generic sg0 type 0
[  168.223431] sd 8:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[  168.224229] sd 8:0:0:0: [sda] Write Protect is off
[  168.224233] sd 8:0:0:0: [sda] Mode Sense: 43 00 00 00
[  168.226623] sd 8:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  168.227214] sd 8:0:0:0: [sda] Optimal transfer size 33553920 bytes
[  168.242050]  sda: sda1 sda2
[  168.243184] sd 8:0:0:0: [sda] Attached SCSI disk
[  173.968517] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[  173.971498] ntfs: (device sda2): parse_options(): Unrecognized mount option windows_names.
[  333.033669] kworker/dying (1014) used greatest stack depth: 12232 bytes left

lsusb gives

Bus 004 Device 002: ID 04e8:4001 Samsung Electronics Co., Ltd PSSD T7
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Changed 5 months ago by Sylvain Miossec

Attachment: smartctl_debug.2.txt added

sudo smartctl -x /dev/sda2 -r ioctl,2 > smartctl_debug.txt

comment:4 Changed 5 months ago by Sylvain Miossec

Hope all this helps.

comment:5 Changed 5 months ago by Christian Franke

Component: smartctlall
Keywords: usb added
Summary: Error Counter logging not supportedATA pass-through support for Samsung T7 SSD (0x04e8:0x4001)
Type: defectenhancement

comment:6 Changed 5 months ago by Christian Franke

The restrictions of Linux UAS mode are possibly not applied for devices with Samsung USB Vendor ID (0x04e8).

According to drive database, some devices with this ID reportedly work with -d usbjmicron. Did you test this?

comment:7 Changed 5 months ago by Sylvain Miossec

With "-d usbjmicron" it is same problem.

$ sudo smartctl -a -d usbjmicron /dev/sda -r ioctl,2
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-gentoo] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: df 10 00 00 01 00 72 0f 00 00 00 fd ]
  scsi_status=0x2, sg_transport_status=0x0, sg_driver_status=0x8
  sg_info=0x1  sg_duration=2 milliseconds  resid=1
  Incoming data trimmed to nothing by resid
  >>> Sense buffer, len=18:
 00     70 00 05 00 00 00 00 0a  00 00 00 00 20 00 00 00
 10     00 00
  status=2: sense_key=5 asc=20 ascq=0
usbjmicron_device::get_registers: scsi error: unsupported scsi opcode
Smartctl open device: /dev/sda [USB JMicron] failed: scsi error unsupported scsi opcode

comment:8 Changed 5 months ago by Christian Franke

Do you have any evidence that pass-through support exists (e.g. output from vendor specific tool)?

comment:9 Changed 5 months ago by Christian Franke

Keywords: nvme added
Summary: ATA pass-through support for Samsung T7 SSD (0x04e8:0x4001)NVMe pass-through support for Samsung T7 SSD (0x04e8:0x4001)

Further research shows that this drive uses NVMe instead of SATA internally, so none of the above -d options would work. Unfortunately there is no vendor independent SCSI to NVMe translation protocol (like -d sat for SCSI to ATA). Smartmontools currently supports two of three known vendor specific protocols (see USB and NVMe wiki pages).

Please try:
smartctl -d sntjmicron ...
smartctl -d sntrealtek ... (requires a recent build from https://builds.smartmontools.org)

comment:10 Changed 5 months ago by Sylvain Miossec

I do not know what pass-through means exactly. I have a windows 7 in virtualbox, I will see if there are vendor specific tools I can test.

For the "smartctl -d sntjmicron" command I get same error

$ sudo smartctl -d sntjmicron -a /dev/sda
Password: 
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-gentoo] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Read NVMe Identify Controller failed: scsi error unsupported scsi opcode

For "smartctl -d sntrealtek" I have to compile from git, it will take me a little more time to test.

Best regards

comment:11 Changed 5 months ago by Sylvain Miossec

I found on this page https://www.anandtech.com/show/14661/usb32-g2-portable-ssds-roundup/2
that the bridge chip is an ASMedia ASM2362

Does it mean that sntrealtek protocol will not work, and reverse engineering must be conducted ?

comment:12 Changed 5 months ago by Sylvain Miossec

With "-d sntrealtek" it is going a bit farther, even if it is not the good bridge chip

$ sudo smartctl -a -d sntrealtek /dev/sda -r ioctl,2
smartctl 7.2 2020-11-23 r5119 [x86_64-linux-5.4.72-gentoo] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

 [NVMe call: opcode=0x06, size=0x1000, nsid=0x00000000, cdw10=0x00000001]
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: e4 00 10 06 01 00 00 00 00 00 00 00 00 00 00 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=2 milliseconds  resid=4096
  Incoming data trimmed to nothing by resid
  [Duration: 0.002s]
 [NVMe call succeeded: result=0x00000000
 00     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 10     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 ...
 ]
=== START OF INFORMATION SECTION ===
Model Number:                       
Serial Number:                      
Firmware Version:                   
PCI Vendor ID:                      0x0000
PCI Vendor Subsystem ID:            0x0000
IEEE OUI Identifier:                0x000000
Total NVM Capacity:                 0
Unallocated NVM Capacity:           0
Controller ID:                      0
Number of Namespaces:               0
Local Time is:                      Wed Dec  2 11:37:41 2020 CET
Firmware Updates (0x00):            0 Slots
Optional Admin Commands (0x0000):   -
Optional NVM Commands (0x0000):     -
Maximum Data Transfer Size:         -
Warning  Comp. Temp. Threshold:     -
Critical Comp. Temp. Threshold:     -
Namespace 4294967295 Features (0x00):      -

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     0.00W       -        -    0  0  0  0        0       0

=== START OF SMART DATA SECTION ===
 [NVMe call: opcode=0x02, size=0x0200, nsid=0xffffffff, cdw10=0x007f0002]
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: e4 00 02 02 02 00 00 00 00 00 00 00 00 00 00 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=0 milliseconds  resid=512
  Incoming data trimmed to nothing by resid
 [NVMe call succeeded: result=0x00000000
 00     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 10     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 ...
 ]
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        -
Available Spare:                    0%
Available Spare Threshold:          0%
Percentage Used:                    0%
Data Units Read:                    0
Data Units Written:                 0
Host Read Commands:                 0
Host Write Commands:                0
Controller Busy Time:               0
Power Cycles:                       0
Power On Hours:                     0
Unsafe Shutdowns:                   0
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               -
Temperature Sensor 2:               -
Temperature Sensor 3:               -
Temperature Sensor 4:               -
Temperature Sensor 5:               -
Temperature Sensor 6:               -
Temperature Sensor 7:               -
Temperature Sensor 8:               -
Thermal Temp. 1 Transition Count:   0
Thermal Temp. 2 Transition Count:   0
Thermal Temp. 1 Total Time:         0
Thermal Temp. 2 Total Time:         0

 [NVMe call: opcode=0x02, size=0x0040, nsid=0xffffffff, cdw10=0x000f0001]
>>>> do_scsi_cmnd_io: sg_io_ver=3
 [<vendor specific>: e4 40 00 02 01 00 00 00 00 00 00 00 00 00 00 00 ]
  scsi_status=0x0, sg_transport_status=0x0, sg_driver_status=0x0
  sg_info=0x0  sg_duration=0 milliseconds  resid=0
  Incoming data, len=64:
 00     00 08 50 00 00 00 00 00  00 01 00 b0 00 3c 00 00
 10     00 01 00 00 ff ff 00 00  ff ff 00 00 ff ff 00 00
 20     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 30     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 [NVMe call succeeded: result=0x00000000
 00     00 08 50 00 00 00 00 00  00 01 00 b0 00 3c 00 00    ..P..........<..
 10     00 01 00 00 ff ff 00 00  ff ff 00 00 ff ff 00 00    ................
 20     00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................
 ...
 ]
Error Information (NVMe Log 0x01, max 1 entries)
Num   ErrCount  SQId   CmdId  Status  PELoc          LBA  NSID    VS
  0    5244928   256  0xb000  0x3c00  0x000 281470681743616 65535  0xff
Last edited 5 months ago by Sylvain Miossec (previous) (diff)

comment:13 Changed 5 months ago by Sylvain Miossec

I found a ticket was already opened for ASM2362 https://www.smartmontools.org/ticket/1221

comment:14 Changed 5 months ago by Christian Franke

Ticket #1221 is already mentioned on the NVMe wiki page.

Thanks for finding the info that the ASM bridge chip is used. Support for its NVMe pass-through command will be added to smartmontools if someone provides a well tested patch or a device for testing.

comment:15 Changed 5 months ago by Christian Franke

Milestone: undecided
Resolution: duplicate
Status: newclosed

See ticket #1221.

comment:16 Changed 4 months ago by Sylvain Miossec

Some box for NVME SSds with this chip are available for 14€ on Aliexpress. Can I buy one and program delivery for you ?

comment:17 in reply to:  16 Changed 3 months ago by Christian Franke

Milestone: Release 7.3

Replying to Sylvain Miossec:

... Can I buy one and program delivery for you ?

Thanks! No longer needed :-)

Please test r5169 or later. CI builds are available at https://builds.smartmontools.org/.

Note: See TracTickets for help on using tickets.