-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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: Add service #26205
fstrim: Add service #26205
Conversation
@gnidorah, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @offlinehacker and @bjornfor to be potential reviewers. |
Can we use the upstream units included in
to get the fstrim units. |
I guess a note like "Note, that it won't TRIM whole SSD, but only mounted filesystems. Unused partitions and unused LVM space should be TRIMmed manually." should be added. Personally, I use an adapted script which takes care of unallocated LVM space.
|
@edolstra Thank you much! Let's try it.
|
@danbst Interesting what to do with EFI partition, since fstrim still not supported by vfat. Distros what I've seen do nothing (don't even use discard flag for it). |
I now get cycle detected error. Suggestions? |
Regarding the cycle, where do the units get installed? If they're installed in the same output as the binaries, you shouldn't get a cycle. Then you also don't need to patch out the ExecStart paths and don't need to override ExecStart in the module. (The usefulness of the Yes, a |
@edolstra Thanks! Haven't meet split derivations before, moved units installation from |
Seems to work here. BTW, do these systemd-related configure flags also need to be added to |
Given that this changes util-linux, I expect this will be a large rebuild. Perhaps should go via staging. |
Merged to staging, thanks! |
@edolstra Thank you! |
@bjornfor Installed |
@gnidorah: I don't understand what that means. |
@bjornfor |
Motivation for this change
Provide fstrim service and timer, like other systemd distros do today https://www.digitalocean.com/community/tutorials/how-to-configure-periodic-trim-for-ssd-storage-on-linux-servers
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)