Comment 12 for bug 1907262

Revision history for this message
Eric Desrochers (slashd) wrote :

For Trusty and Xenial, fstrim is scheduled via cron[0] to run weekly at each Sunday at 6h47[1].
For Bionic onward, fstrim is scheduled via systemd timer to also run weekly[2]

Impacted users may want to take action before the next scheduled run by downgrading the running kernel or temporarily disabling the fstrim job.

[Trusty and Xenial]
By default, an /etc/cron.weekly/fstrim job is installed, but this may be supplanted by local modifications.

Check if you are running a cron job which might invoke fstrim:
$ sudo grep -r fstrim /etc/cron*

If an fstrim job is found in the results of the above command, edit the appropriate file and comment out the command with a “#” at the beginning of the line to disable the execution of fstrim.

For the default Ubuntu configuration, the command in the /etc/cron.weekly/fstrim file starts with “/sbin/fstrim” or “exec fstrim-all” and is the last line of the file.

[Bionic or late]
$ sudo systemctl disable --now fstrim.timer
$ sudo systemctl mask fstrim.service

[0] - /etc/cron.weekly/fstrim
[1] - grep -i weekly /etc/crontab:
[2] - systemctl status fstrim.timer | grep "Trigger:"