Stop watching your SSD performance degrade because you forgot fstrim
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop watching your SSD performance degrade because you forgot fstrim
🧩 The Challenge
Everyone ignores SSD maintenance until the database suddenly starts crawling and write latency hits the floor. I’ve spent days debugging slow application performance only to realize the flash controller was gasping for air because the filesystem had no idea which blocks were actually free.
💡 The Fix
Enabling the fstrim timer tells the kernel to tell the SSD which pages are no longer in use, letting the controller clean up and garbage collect in the background. It saves you from the inevitable performance cliff that happens when an SSD gets near capacity.
systemctl enable --now fstrim.timer
⚙️ Why It Works
This command kicks off the native systemd timer that runs a trim operation once a week by default. It keeps your SSD thin-provisioned and prevents it from wearing itself out moving junk data around.
🚀 Pro-Tip: Run systemd-analyze calendar ‘*-*-* 00:00:00’ to see when it’s going to fire next.
Linux Tips & Tricks | © ngelinux.com | 9/30/2026
