fstrim.service is no longer trimming filesystems
Edit: Bug raised and fixed in v2.35.2 by 61b384b
I posted this on the arch forums in this thread but it got very little response so posting here. See that thread for more details.
Ever since the recent upgrade to the util-linux package to v2.35 the fstrim.timer has been running but has not been trimming drives. If fstrim is run manually it works fine. Here is the output of journalctl -u fstrim.service.
util-linux was upgraded after fstrim.timer ran on Jan 25 on boot up. Booting the laptop today you can see there is no log of fstrim being run against my root filesystem. I have confirmed this on three separate machines running Arch now and confirmed by a user in the arch forum thread. Are you guys getting the same issue?
-- Reboot --
Jan 25 14:20:31 hp-laptop systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jan 25 14:20:42 hp-laptop fstrim[414]: /: 217.7 GiB (233766383616 bytes) trimmed on /dev/sda1
Jan 25 14:20:42 hp-laptop systemd[1]: fstrim.service: Succeeded.
Jan 25 14:20:42 hp-laptop systemd[1]: Started Discard unused blocks on filesystems from /etc/fstab.
-- Reboot --
Feb 01 12:57:58 hp-laptop systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Feb 01 12:57:59 hp-laptop systemd[1]: fstrim.service: Succeeded.
Feb 01 12:57:59 hp-laptop systemd[1]: Started Discard unused blocks on filesystems from /etc/fstab.
Edited 4 Feb 2020. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 51 · 100% up
- Kind
- Text
- ID
- ex64oz
25 comments
The problem is
ProtectSystem=strict, removing that fixes it. But why this is only a problem recently I have no idea, as this has been there since util-linux v2.34.Edit: A strace shows this error:
access("/mnt/storage0", W_OK) = -1 EROFS (Read-only file system)Possibly this commit that caused it: f227757c fstrim: ignore non-directory mountpoints, also this issue. I think
ProtectSystem=strictuses bind mounts and was overlooked by that commit.Just to add to this, if you have your /home on a separate partition you will now also need to comment this line out or set to 'no'
Thanks. Yes, that worked for me too. As you say, very strange why this suddenly manifested itself in v2.35.
Deleted before we saved it.
Deleted before we saved it.
I thought that but when it did run with output on my other machines with more filesystems to do, the time between starting and succeeded was longer than it currently is which leads me to believe it's not actually doing anything.
Deleted before we saved it.
if there is no other output you could try running it with strace
and see a bit more of what its doing
(/dev/shm will be gone after reboot, feel free to change the output target location)
Did you open a bug report?
I did with systemd originally but it got closed as they said the timer ran on schedule and said successful. I was told it was a fstrim or util-linux issue as the fstrim.service/timer is created by that.
Yup. My first guess would be that it's still working, but not recording the specifics...
Just checked, same for me. Worked on 20/01 but not on 27/01, when it took 1 second to run instead of 15-16 like before. Launching manually seems to work
Confirmed here too -- on util-linux 2.35.1
Deleted before we saved it.
I have fstrim.timer disabled. It wakes up all of my hard drives from standby, which is an absolute nightmare really.
I'm fine with running it once a while manually. It's not like anything breaks if you don't.
Deleted before we saved it.
I guess it scans all drives for UUIDs or something
fstrim is also dangerous, it's a data ditcher
https://bugs.archlinux.org/task/62693
Such bugs happen from time to time, no incident since... 9 months
it's better to run this manually, and run it on a known stable kernel (.15, not .1), or ... just not run it at all. Because it's not worth the risk, and most users wouldn't even notice any difference, ever.
trim is so overrated
ymmv