How to make possible to use trim/discard functions on SSD connected via USB. Trim not working in such case by default: its a long story about ATA, SCSI and USB....
There is an set of UDEV rules to enable trim/discard for usb connected SSDs with differnt USB-SATA/NVME controllers (Realtek, VIA, ASM)
File 50-usb-ssd-trim.rules must be placed to /etc/udev/rules.d
then reload udev like
udevadm control -R -S
or
service udev force-reload
Then
lsblk --discard
if DISC-GRAN not equal to zero then trim working, it must be 0 on HDDs
Commits are welcome. Please send only tested VID,PID
Use on own risk only: some USB storage not handle trim correctly, even can be damaged
tested on my own USB SSD drives
based on