[systemd-devel] fstrim "cron" job

Marcos Mello marcosfrm at gmail.com
Sat Dec 21 06:38:56 PST 2013


Bastien Nocera <hadess <at> hadess.net> writes:

> 
> Hey,
> 
> I've seen that Ubuntu recently added transparent support for trimming
> filesystems on SSDs:
> https://blueprints.launchpad.net/ubuntu/+spec/core-1311-ssd-trimming
> and in the patch for util-linux:
> https://launchpadlibrarian.net/159909554/util-linux_2.20.1-5.1ubuntu11.diff.gz
> 
> (looks for fstrim-all)
> 
> I wanted to integrate that in Fedora, through a systemd daily unit. I
> was wondering whether this sort of integration (I'd intend to port the
> fstrim-all code to C) should be in systemd itself, or whether it should
> be a unit shipped separately (in the util-linux package maybe?).
> 
> Cheers
> 

Karel added fstrim "--all" recently (util-linux 2.24-git):

https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=36c370cbf1
https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=e05a3400e7
https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=d6bbe8044b

The only missing feature compared to the shell script Ubuntu ships is detect
when the FS has "discard" in fstab to skip it. Once this is in place, no
shell will be needed at all. Just a one-liner "ExecStart" systemd unit.

--
Marcos



More information about the systemd-devel mailing list