RPi4 LE 9.2.3 USB3-SATA SSD data storage TRIM support

  • I have my RPI4 running LE 9.2.3 and have a Eluteng USB3 to SATA adapter (ASMedia based) connected to a WD 500GB SSD. I use the SSD to store the recordings that TVH addon produces.

    Everything is working but I wanted to make sure SSD TRIM works properly. I created the udev rules file in /etc/udev/rules.d to support trim and unmap using the same one I use on Raspberry PI OS (32bit) and this allowed me to run fstrim -v /var/media/path-to-mounted-ssd and that worked.

    What is different on LE is there is no fstrim.timer service. On Raspberry PI OS I would enable the weekly timer by sudo systemctl enable fstrim.timer and the trim function would happen weekly.

    Any advice on implementing the fstrim.timer in LE? Maybe copy the fstrim.timer exactly from Raspberry PI OS? Where should that be put on LE??

  • Not sure if this will work, but I did copy the Raspberry PI OS fstrim.service and fstrim.timer to /storage/.config/system.d and then I did systemctl enable fstrim.timer. The timer seems to be enabled, no further information until it runs and post something to the journal.

    • Official Post

    As a side note, TRIM was available as per Linux kernel 3.8 I think, so that was ages ago.

    The question may also be whether your USB3 adapter itself properly supports it.

  • As a side note, TRIM was available as per Linux kernel 3.8 I think, so that was ages ago.

    The question may also be whether your USB3 adapter itself properly supports it.

    The adapter choice is critical. Both of the adapters I have are ASMedia 115x based and they usually work without issue with UAS and TRIM. I have the Startech and the Eluteng adapters. The fstrim command worked for me on LE 9.2.3 once I put the right udev rules file in the rules.d directory. So now it's up to the systemd setup for fstrim.timer