TRIM support for USB drives?

olli@

Well-Known Member
Developer

Reaction score: 306
Messages: 361

I've got two external SSD drives (Samsung T5) that support TRIM / UNMAP according to the vendor's specifications. However, FreeBSD doesn't seem to recognize that feature: diskinfo -v says it's not supported, and when I run newfs -t on the drive and then mount it, I also get a message saying that TRIM is not supported. This is stable/12 (amd64), just a few days old. Other than that, the drives work ok with FreeBSD, although much slower than under Windows or Linux, but I think that's a known issue of FreeBSD's USB stack. smartctl on the drives also works fine.

Does anyone know if TRIM / UNMAP is generally unsupported for USB drives with FreeBSD? I remember seeing commits some time ago that referred to USB + TRIM, but I don't remember the details. Does it only work for certain kinds of USB devices?
 
Last edited:

mark_j

Member

Reaction score: 17
Messages: 73

Are you sure they support it? I remember the T3 and it didn't support it.
Try using tunefs -t enable /dev/xxx
(oh, where xxx is your usb device)
 
OP
OP
olli@

olli@

Well-Known Member
Developer

Reaction score: 306
Messages: 361

Are you sure they support it? I remember the T3 and it didn't support it.
Yes, that's a new feature of the T5. See the Review at Tom's Hardware (“Previous versions of the Samsung Portable SSD did not support TRIM. The new T5 products accept the command from the host through the UASP protocol.”) and the Review at AnandTech (“Support for TRIM (unavailable in the previous Samsung Portable SSDs)”).
Try using tunefs -t enable /dev/xxx
(oh, where xxx is your usb device)
That has exactly the same effect as newfs -t.

Reading the review at Tom's Hardware (see the link above), it says that support for TRIM is only available through the UASP protocol. As far as I know, FreeBSD does not support UASP … That also explains why the SSD is rather slow with FreeBSD, I guess. :-(
 
Top