Enable fstrim service for SSD/NVMe drives

If you use SSD (solid-state drives) or NVMe, fstrim service is useful for you. fstrim is used on a mounted file system to discard (trim) blocks that are not in use by the file system.

systemctl enable fstrim.timer
systemctl start fstrim.timer

Solid State Drive - ArchWiki


Funny story… when my old PC broke down, I bought a new one and after installing Mabox I forgot to turn on fstrim. That was over 600 days ago and everything was working fine for a long time. Recently, however, I have noticed serious slowdowns when performing tasks that require frequent writing and reading from the disk. Problems occurred when using VirtualBox, sometimes Firefox slowed down a lot, but the worst problems occurred when building test Mabox ISO images. For some time I thought the disk was dying - until I finally remembered fstrim.

After turning on fstrim, building the ISO takes 5 minutes, not 25-30 like recently :wink:

The difference in performance can be huge and it is worth enabling fstrim before problems arise.


I will have to check this out.