[Feature suggestion] Install and use systemd's fstrim.timer

This feature suggestion was filed in December 2019 at TJC, and was discussed among community members in January 2020, basically reaching consensus that this makes sense to be deployed (for details see the original thread at TJC): Please install and use systemd’s fstrim.timer

Because Together.Jolla.com has been put into read-only state more than a year after this initial conversation about this feature suggestion, and the promised transfer of content from TJC to this forum never materialised, this feature suggestion has to be re-filed here to be able to track and discuss it any further.

I still would appreciate any feedback by sailors on the content of this feature suggestion.
I also do not have the impression that this topic was ever considered at Jolla, at least I have not found anything mentioned anywhere in this regard at TJC or FSO besides my post.

P.S.: Cut & Paste of the core content of this feature suggestion.

Please install and use systemd’s fstrim.timer

asked Dec 21 2019

olf gravatar image

10393 ●104 ●201 ●158

updated Jan 13 2020

Dear sailors,

please install and use systemd’s fstrim.timer to regularly (e.g. weekly) trigger a “block discard” (“trim”) on FLASH media which supports it.

In the past (long ago) SailfishOS mounted (only) vFAT filesystems with the “direct discard” option, but now it never executes a discard / trim for all filesystems AFAICS.

Performing a fstrim -a manually is working fine on SailfishOS since at least v2.2.0, even on encrypted partitions (their “trim” capability can be easily checked manually per lsblk -D ); tested on Jolla 1 and Xperia X.

HTH & happy sailing!

P.S.: … and the outcome for Fedora is “[Phoronix] Fedora 32 Greenlit For Enabling FSTRIM Support By Default”, which is what most other Linux distributions already implement.


Would something like this implement that?

Builds a new util-linux-systemd-fstrim subpackage containing the service and timer files.

(Also I have taken the liberty to move this topic into the Feature Requests category)


This is looking good, AFAICS: Primarily I read the spec file changes, though your use of the build infrastructure (OBS & for chum) also looks really fine.

Have you tested the generated package, if it installs and works (i.e., trims regularly) as intended?

I have not tested those particular binaries. But I have tried the .service/.timer and they do what they are supposed to.

Installation works fine, it enables but doesn’t start the timer though. Not sure what the right incantation in %post is to do that.
Reboot helps and timer is started correctly.
Uninstallation is also fine.

I have done a rebuild with relaxed dependencies so just the package can be installed without requiring the rebuilt binary package .

So test away! :slight_smile:


But the principal question remains (as with most suggestions / feature requests), even though all technical work is done:
How do we get Jolla’s attention directed at this?

I know, putting this on the list for an “IRC community meeting”, attending it and proposing this there would be a way (but not for me, personally), but that usually results in no specific feedback, anyway.
Furthermore, I would rather keep the discussion (with sailors) here (where it belongs, IMO, plus where the context is).

1 Like

@olf - I would expect fstrim to be enabled for storage. Maybe should classify this as a bug.

This forum was expected to be communication channel with Jolla developers, so let’s see if it gets picked up as it should.

I think a pull request would be the proper way forward.

I’m not planning to do that, but anyone obviously is welcome to take my changes above and make one. It is simple enough really.

Well, that is what I originally did (for exactly that reason: more likely to catch a sailor’s attention when filed as a bug, plus it really is “half a bug, half a feature request” IMO), but @nephros had a different opinion and changed it to be a feature request.

I am more than tired of applying the “let’s see if it gets picked up as it should” method, which often works fine elsewhere, but almost never WRT Jolla (i.e., at FSO, TJC, git.sailfishos.org etc.), but in the end it is up to them to continue ignoring most contributions (or change their ways and at least leave a comment). Mind that this bug / feature suggestion is already almost 2 years old, and never received any attention from a sailor.
Well, the only thing I can do is to document that clearly.


Done: https://github.com/sailfishos/util-linux/pull/2
Update (2021-09-06): After a single substancial change request (Requires: xyz-develRequires: pkgconf(xyz)) and multiple nitpicking and partially inconsistent (compared to the extant code) change requests in a row, I refiled the MR as https://github.com/sailfishos/util-linux/pull/3
Seems to be in “Jolla state” since then: Stalled with no feedback.

P.S.: @nephros, thank you very much for implementing this, plus creating an easily testable package, and your general support WRT this bug / feature request.