Site Tools


Sidebar

hardwarerelated:nvme_enclosure

What's this?

  • I bought an external enclosures, connected via USB3, to run NVMe
  • enclosure 1 details:
  • enclosure 2 details:
    • disappeared from Amazon-Japan
    • lsusb: ID 0bda:9210Realtek Semiconductor Corp. RTL9210 M.2 NVME Adapter
    • can do TRIM, with extra udev rule

Udev rule to perform TRIM

Mounting the device per default, no TRIM is supported:

fstrim: /mnt/tmp: the discard operation is not supported

Setting up a special udev rule:

# cat >/etc/udev/rules.d/10-extern-nvme.rules <<EOT
ACTION=="add", SUBSYSTEM=="scsi_disk", SUBSYSTEMS=="usb", ATTRS{idVendor}=="174c", ATTRS{idProduct}=="2362", ATTR{provisioning_mode}="unmap"
ACTION=="add", SUBSYSTEM=="scsi_disk", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="9210", ATTR{provisioning_mode}="unmap"
EOT
# udevadm trigger

Then unplug/plug the device, and after mounting 'fstrim' succeeds.

Performance impact intern vs. extern NVMe

Running the 256GB SSD internally in a Thinkpad L480, measuring uncached reads blockwise:

# dd if=/dev/nvme0n1 of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.771196 s, 1.4 GB/s

Connecting the same drive externally via the enclosure:

# dd if=/dev/sda of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.42096 s, 444 MB/s
hardwarerelated/nvme_enclosure.txt ยท Last modified: 2024/03/03 07:18 by chris