M
malch
Guest
So my 512GB Samsung T5 USB SSD arrived today from B&H.
I used a Samsung utility (not Magician, they have a different one for USB drives) to make sure the firmware was current. It was.
Installing Manjaro was simple enough. One of the first things I wanted to do was to check that I could use TRIM on a USB connected device. Well, it no workee.
Samsung specifically advertise trim support so this was disappointing.
sudo hdparm -I /dev/sdb
reported Data Set Management TRIM supported.
After a lot of research I did this:
sudo pacman -S sg3_utils
sudo sg_readcap -l /dev/sdb
This shows lbpme=0. Linux apparently requires the device/controller to report lbpme=1 for TRIM to work (although it seems Windows doesn't). There has been a proposal to modify the kernel to make it less picky but it seems to be deferred. But I was able to override lbpma with a udev rule:
ACTION=="add|change", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="61f5", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
The vendor and product id's were easily found from lsusb.
With the udev rule TRIM works as confirmed with this test:
https://andyduffell.com/techblog/?p=852
Not sure if the invalid lbpma is Samsung's fault or if the controllers/BIOS/drivers in the chain have cleared it.
I should note that I deleted the "discard" rules from /etc/fstab. I prefer to trim manually on demand versus continuously. I perform the trim as part of a larger system update and maintenance script that I run once or twice a week.
In any event, I'm very happy to have this USB SSD working and with TRIM. Now to finish the Linux install with my usual customizations and packages.
I used a Samsung utility (not Magician, they have a different one for USB drives) to make sure the firmware was current. It was.
Installing Manjaro was simple enough. One of the first things I wanted to do was to check that I could use TRIM on a USB connected device. Well, it no workee.
Samsung specifically advertise trim support so this was disappointing.
sudo hdparm -I /dev/sdb
reported Data Set Management TRIM supported.
After a lot of research I did this:
sudo pacman -S sg3_utils
sudo sg_readcap -l /dev/sdb
This shows lbpme=0. Linux apparently requires the device/controller to report lbpme=1 for TRIM to work (although it seems Windows doesn't). There has been a proposal to modify the kernel to make it less picky but it seems to be deferred. But I was able to override lbpma with a udev rule:
ACTION=="add|change", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="61f5", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
The vendor and product id's were easily found from lsusb.
With the udev rule TRIM works as confirmed with this test:
https://andyduffell.com/techblog/?p=852
Not sure if the invalid lbpma is Samsung's fault or if the controllers/BIOS/drivers in the chain have cleared it.
I should note that I deleted the "discard" rules from /etc/fstab. I prefer to trim manually on demand versus continuously. I perform the trim as part of a larger system update and maintenance script that I run once or twice a week.
In any event, I'm very happy to have this USB SSD working and with TRIM. Now to finish the Linux install with my usual customizations and packages.
Last edited:
