-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fstrim: timer and service unit on fstab-less systems #1019
Comments
We originally had "fstrim --all" instead of "fstrim --fstab" in the service file. I think the option --all is still usable and you can use it in fstab-less systems. The disadvantage is that it will try to trim also manually and temporarily connected media, but I don't think it's so big problem. All you need is to replace --fstab with --all in the service file on package install. |
Rather than overriding the complete |
I have no problem to accept whatever what will work for your use-case as well as for mainstream (fstab based) use-case ;-) |
@karelzak yes, I think my original question was more about what is your preferred integration point for distros. That is, a sort of public API for systemd units. |
I'm not sure if I understand @dustymabe's idea with OPTIONS=. Do you mean to define something like:
would it be better to use sed s/--fstab/--all/ in your installation scripts? Yes, #1016 seems unwanted. |
Right, and then we'd use an override to override OPTION to set it to
I don't think so because it's nice to know where configuration comes from so we should leave what comes from util-linux in tact. I think probably the bigger question we are trying to answer is what do we think is approprate to do for systems that don't have an fstab? If
|
From my point of view --all is good enough. The option --fstab has been introduced later to avoid removable or manually mounted filesystems (but these filesystems also need to trim, so --fstab is bad in some cases). |
I'd like to finalize this, what about to specify on fstrim command line multiple sources and the command will use the first usable, something like:
The result will be that you do not have to modify the service file at all. |
This new option works like --all but it allows to specify multiple files with filesystems to make fstrim configuration more portable between distributions. For example: fstrim --listed-in /etc/fstab:/proc/self/mountinfo forces fstrim to try fstab and if unsuccessful than try mountinfo. Addresses: #1019 Signed-off-by: Karel Zak <kzak@redhat.com>
Please, test it in your environment. Thanks. |
@dustymabe and @lucab is --listen-in usable for you? |
@karelzak sorry, I forgot to come back to this. Yes, I think that would do it. Do you still plan for distributions to be able to tune this? If so, you may consider to tweak the service unit as such:
That way distributions can simply adjust the |
Well, the idea of the --listed-in is that you do not have to modify the service file at all ;-) ... but if you believe that distros still need any changes than I can add FSTRIM_TARGET of course. |
Ack, let's keep it as is for now then. We'll report back if we see any other issue. Thanks for all the feedback! |
This is a followup to the concern at #673 (comment).
Nowadays there exists systemd-based distributions which run without an
/etc/fstab
file, e.g. Container Linux and Fedora CoreOS. Over there, we are wondering how to get the same features provided byfstrim.timer
andfstrim.service
unit in a fstab-less way. #1016 is the first step into that direction, but it only silences the noisy service failure we experience today.So far we had some quick brainstorming at coreos/fedora-coreos-tracker#468 and we came up with two alternative approaches:
/run
.@karelzak what are your thoughts on this?
/cc @jlebon
The text was updated successfully, but these errors were encountered: