Stop fstrim from ignoring your older SSDs
Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop fstrim from ignoring your older SSDs
🧩 The Challenge
You finally moved the database to that high-end NVMe drive, but performance is still crawling because the filesystem thinks it’s still running on a spinning platter from 2005. Nobody told me that some mount options prevent discard commands from ever actually reaching the hardware.
💡 The Fix
Check if your mount options are accidentally stripping the discard flag, then run a manual trim to force the controller to clean up those blocks. It turns an IO-starved drive into a snappy one again.
mount | grep discard
sudo fstrim -av
⚙️ Why It Works
Modern kernels aren’t always aggressive enough with background trimming if the mount point isn’t explicitly told to support it. Running it manually verifies if your hardware actually acknowledges the command before you rely on the automated systemd timer.
🚀 Pro-Tip: Stick this in a weekly cron if your kernel version is older than dirt.
Linux Tips & Tricks | © ngelinux.com | 7/18/2026
