Stop letting your SSDs rot into a performance cliff
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop letting your SSDs rot into a performance cliff
🧩 The Challenge
You finally moved your databases to SSDs, but six months later, they’re crawling like it’s 1999. It’s almost always because the filesystem isn’t actually talking to the hardware about which blocks are dead and gone.
💡 The Fix
Trigger a manual discard on the mount point to clear out those stale blocks, then automate it so you never have to think about it again. Your hardware will thank you, and the latency spikes will vanish.
fstrim -av
⚙️ Why It Works
Running this command forces the filesystem to discard unused blocks that are no longer being tracked by the OS, which prevents the SSD controller from having to shuffle around “dirty” data during write cycles. Enabling the systemd timer ensures this happens periodically without you having to remember it.
🚀 Pro-Tip: Check if your distro has the fstrim.timer enabled by default with systemctl status fstrim.timer, and if it’s dead, enable it immediately.
Linux Tips & Tricks | © ngelinux.com | 11/28/2026
