Today I have checked the status of TRIM with systemctl status fstrim.timer
to display the status:
[uwe@HAL ~]$ systemctl status fstrim.timer
● fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: disabled)
Active: active (waiting) since Sat 2022-07-02 12:06:10 CEST; 9h ago
Until: Sat 2022-07-02 12:06:10 CEST; 9h ago
Trigger: Mon 2022-07-04 00:39:35 CEST; 1 day 2h left
Triggers: ● fstrim.service
Docs: man:fstrim
Jul 02 12:06:10 HAL systemd[1]: Started Discard unused blocks once a week.
All is well, but I am a little confused by the display
vendor preset: disabled
Can this be changed, does it need an additional package?
It sounds to me that the provider of my SSD, to which TRIM is applied here, cannot be read. My English is not good enough that I understand this without a translator. So what service are we talking about here specifically?
indeed exactly what @pebcak mentioned in the first post already…
It says only that after your install the package that ships the systemd service (util-linux) the status is disable but as you can see it is enabled; i this case as it is a timer it will run TRIM periodically once a week (every 7 days)
I suppose some kind of notification that fstrim has taken place would be useful. But that would depend on the notifications given by a certain DE or what you have set up with a window manager. It would be nice to see “fstrim done” or whatever without checking logs etc.
Yeah the hook to notifications would be good. I’m not sure how to do that. I know how to check in a terminal and that is OK but notification would be cool!
If you need to assure yourself that your disks are getting trimmed, just run the following command:
journalctl -u fstrim
This will list all the times fstrim has run in the past, up to the limit of how far back you have logs available. The farther back your logs go, the more instances you will see.
Of course, if you’ve just recently enabled the fstrim.timer service, there won’t be any entries until it has run the first time (by default, it is scheduled to run on each Monday).
Here’s mine; you can see that the fstrim.service ran successfully on the last 5 Mondays:
Stagger_Lee:journalctl -u fstrim
May 30 05:00:06 ts140arch systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
May 30 05:01:11 ts140arch fstrim[236032]: /home: 266.6 GiB (286286237696 bytes) trimmed on /dev/sda2
May 30 05:01:11 ts140arch fstrim[236032]: /: 31 GiB (33280368640 bytes) trimmed on /dev/sda1
May 30 05:01:11 ts140arch systemd[1]: fstrim.service: Deactivated successfully.
May 30 05:01:11 ts140arch systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
-- Boot 8310c2dc828f4ff399a5557b274fca3e --
Jun 06 05:54:39 ts140arch systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jun 06 05:56:07 ts140arch fstrim[136320]: /home: 257.6 GiB (276633874432 bytes) trimmed on /dev/sda2
Jun 06 05:56:07 ts140arch fstrim[136320]: /: 31.3 GiB (33593942016 bytes) trimmed on /dev/sda1
Jun 06 05:56:07 ts140arch systemd[1]: fstrim.service: Deactivated successfully.
Jun 06 05:56:07 ts140arch systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
-- Boot 58e277ecf1e84bddb927825a8537d69c --
Jun 13 06:07:04 ts140arch systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jun 13 06:08:31 ts140arch fstrim[142110]: /home: 258.2 GiB (277284184064 bytes) trimmed on /dev/sda2
Jun 13 06:08:31 ts140arch fstrim[142110]: /: 28.7 GiB (30848868352 bytes) trimmed on /dev/sda1
Jun 13 06:08:31 ts140arch systemd[1]: fstrim.service: Deactivated successfully.
Jun 13 06:08:31 ts140arch systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
-- Boot b3d393ac1da847aaaf796a1529a5388b --
Jun 20 04:41:49 ts140arch systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jun 20 04:43:09 ts140arch fstrim[29947]: /home: 262.3 GiB (281591779328 bytes) trimmed on /dev/sda2
Jun 20 04:43:09 ts140arch fstrim[29947]: /: 27 GiB (28987314176 bytes) trimmed on /dev/sda1
Jun 20 04:43:09 ts140arch systemd[1]: fstrim.service: Deactivated successfully.
Jun 20 04:43:09 ts140arch systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
-- Boot e2bdd9d7e16d4ddda90c37ba77555afc --
Jun 27 05:55:15 ts140arch systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jun 27 05:56:34 ts140arch fstrim[268349]: /home: 262.9 GiB (282256658432 bytes) trimmed on /dev/sda2
Jun 27 05:56:34 ts140arch fstrim[268349]: /: 25.6 GiB (27532525568 bytes) trimmed on /dev/sda1
Jun 27 05:56:34 ts140arch systemd[1]: fstrim.service: Deactivated successfully.
Jun 27 05:56:34 ts140arch systemd[1]: Finished Discard unused blocks on filesystems from /etc/fstab.
Stagger_Lee:
@fbodymechanic@Stagger_Lee yeah I have enabled the service but I had disabled my logging in journalctl for some reason I forget! My bad! Any clues on how to re-enable this?