Stop your SSDs from slowing to a crawl without manually fstrim-ing
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop your SSDs from slowing to a crawl without manually fstrim-ing
🧩 The Challenge
You finally notice your database box is dragging, and you realize you haven’t run a trim operation on the SSDs in months. It’s ridiculous that we still have to babysit flash storage so it doesn’t lose its mind under write pressure.
💡 The Fix
Turn on the systemd timer for fstrim so you never have to think about it again. It handles the cleanup tasks in the background during quiet hours.
systemctl enable --now fstrim.timer
⚙️ Why It Works
By enabling the timer, you are offloading the maintenance to the init system rather than adding yet another cron job you’ll eventually forget to check. The kernel will periodically issue discard commands to the SSD, keeping write speeds from tanking as the drive fills up.
🚀 Pro-Tip: Check /etc/fstrim.d/fstrim.timer if you want to change how often it runs, but honestly, the default is usually fine.
Linux Tips & Tricks | © ngelinux.com | 7/29/2026
