![fstrim에 타이머가 없는 것 같습니다. 작동하는지 어떻게 확인할 수 있나요?](https://linux55.com/image/227102/fstrim%EC%97%90%20%ED%83%80%EC%9D%B4%EB%A8%B8%EA%B0%80%20%EC%97%86%EB%8A%94%20%EA%B2%83%20%EA%B0%99%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%9E%91%EB%8F%99%ED%95%98%EB%8A%94%EC%A7%80%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%ED%99%95%EC%9D%B8%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%3F.png)
"util-linux 패키지는 fstrim.service 및 fstrim.timer systemd 장치 파일을 제공합니다. 타이머를 활성화하면 서비스가 매주 활성화됩니다. 서비스는 폐기 작업을 지원하는 장치의 마운트된 모든 파일 시스템에서 fstrim(8)을 수행합니다. "
에서:https://wiki.archlinux.org/title/Solid_state_drive
너무 자주 또는 너무 드물게 실행해서는 안 된다는 내용을 읽었기 때문에 일주일에 한 번 실행되도록 하고 싶습니다.
그러나 타이머가 없는 것 같습니다.
# systemctl list-timers |grep fstrim
# cat /etc/systemd/system/fstrim.timer
cat: /etc/systemd/system/fstrim.timer: No such file or directory
fstrim.service 파일 자체는 다음과 같습니다.
# 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
주간 벤치마크는 어디에 지정되어 있나요? 매주 또는 전혀 실행되도록 하려면 어떻게 해야 합니까?
답변1
$ systemctl list-unit-files '*trim*'
UNIT FILE STATE VENDOR PRESET
fstrim.service static -
fstrim.timer enabled enabled
$ systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/lib/systemd/system/fstrim.timer
$ grep Cal /lib/systemd/system/fstrim.timer
OnCalendar=weekly
기본 시스템 파일은 /lib/systemd/system
여러 다른 위치에 있고 로컬로 사용자 정의된 파일은 에 있습니다 /etc/systemd/system
.