Why is fstrim.timer blocked by /etc/initrd-release?

I finally got around to setting up trim support, I needed to perform a firmware upgrade first. So all seems to be working until I tried to start the fstrim.timer. It fails because /etc/initrd-release exists, an empty file. huh? Why does fstrim.timer not run if this file exists?

$ 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: inactive (dead)
    Trigger: n/a
   Triggers: ● fstrim.service
  Condition: start condition failed at Sat 2021-07-17 14:48:30 CDT; 2s ago
             └─ ConditionPathExists=!/etc/initrd-release was not met
       Docs: man:fstrim

Edit: The file is not owned by any package on my system. But that does not mean it was not installed by a package. It is also possible that I created this file at sometime in the past. But in the back of my mind, I am thinking this was recently added… or was that /etc/os-release?

Check if the file exists. If the file exists remove it. You might want to check the contend and do a backup first.

The =! negates the test. Which means the files needs to be absent.

The file does exist, but I am not sure why it exists. And it strikes me as very odd that fstrim.timer would be coded to not run, if the file does exist. I believe systemd uses/used the file as a flag, for what to run or load during the boot process.

Usually, the file is an indicator that the root file system is mounted from a initrd file.

If the file is in your normal root fs there is obviously something worng.

You might want to find out at which point it was created and what happed also at this it.


Since it is ARM it might be different, not sure how this works on non x86 or x86_64

Hmm, interesting. I was working with systemd.volatile=overlay, which I believe does do that very thing.

Edit: I renamed the file and restarted fstrim.timer. I’ll take this for a solution.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.