User Tools

Site Tools


Sidebar

hardwarerelated:nvme_enclosure

What's this?

  • I replaced my 256GB NVMe M.2 SSD with a 1TB model. For the old 256GB drive I bought an external enclosure, connected via USB.
  • enclosure details:

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
ACTION=="add", SUBSYSTEM=="scsi_disk", SUBSYSTEMS=="usb", ATTRS{idVendor}=="174c", ATTRS{idProduct}=="2362", ATTR{provisioning_mode}="unmap"
EOT
# udevadm trigger

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

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: 2021/01/10 09:12 by chris