fstrim doesn't appear to have any timers, how do I make sure it works?
1
vote
1
answer
535
views
"The util-linux package provides fstrim.service and fstrim.timer systemd unit files. Enabling the timer will activate the service weekly. The service executes fstrim(8) on all mounted filesystems on devices that support the discard operation."
From: https://wiki.archlinux.org/title/Solid_state_drive
I wanted to make sure it runs weekly, as I've read it shouldn't run too often, and not too rarely.
However, it doesn't appear to have any timers:
# systemctl list-timers |grep fstrim
# cat /etc/systemd/system/fstrim.timer
cat: /etc/systemd/system/fstrim.timer: No such file or directory
The fstrim.service file itself is:
# systemctl cat fstrim.service
# /usr/lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks on filesystems from /etc/fstab
Documentation=man:fstrim(8)
ConditionVirtualization=!container
[Service]
Type=oneshot
ExecStart=/usr/bin/fstrim --listed-in /etc/fstab:/proc/self/mountinfo --verbose --quiet-unsupported
PrivateDevices=no
PrivateNetwork=yes
PrivateUsers=no
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@default @file-system @basic-io @system-service
Where is the weekly basis specified? How do I make sure it runs weekly, or at all?
Asked by AlphaCentauri
(802 rep)
Dec 1, 2023, 08:22 PM
Last activity: Dec 2, 2023, 04:08 AM
Last activity: Dec 2, 2023, 04:08 AM