fstrim.timer, was: Mounting XFS with discard option only works for /boot but not /

Chris Murphy lists at colorremedies.com
Tue Nov 25 22:38:16 UTC 2014


On Fedora 21, looks like there's a new systemd unit "fstrim.timer"
which is disabled by default. Easily enabled with 'systemctl enable
fstrim.timer' and will issue trim for all mounted trim supporting
volumes once per week.


[root at f21s ~]# systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
   Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled)
   Active: inactive (dead)
     Docs: man:fstrim

[root at f21s ~]# cat /usr/lib/systemd/system/fstrim.timer
[Unit]
Description=Discard unused blocks once a week
Documentation=man:fstrim

[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true

[Install]
WantedBy=multi-user.target

[root at f21s ~]# cat /usr/lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks

[Service]
Type=oneshot
ExecStart=/usr/sbin/fstrim -a


Chris Murphy


More information about the test mailing list