Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop ignoring the mount flags that kill your performance
đź§© The Challenge
Ever notice your SSD crawling even though the IO wait looks fine, only to realize months later that the kernel isn’t actually cleaning up discarded blocks? I spent a whole weekend thinking I had a bad controller before I realized the filesystem was just choked with stale data.
đź’ˇ The Fix
Use findmnt to verify your discard mount options and ensure your drive is actually being trimmed periodically. It’s an easy win that keeps your flash storage from grinding to a halt over time.
findmnt -no OPTIONS / | grep discard
⚙️ Why It Works
This command digs through the mount table to see if your filesystem is configured for online discards, which lets the drive handle housekeeping automatically instead of letting garbage pile up. If that output is empty, you need to either add discard to your fstab or enable the fstrim timer service.
🚀 Pro-Tip: If you’re on a busy database server, skip online discards and just enable the weekly fstrim systemd timer to avoid latency spikes during writes.
Linux Tips & Tricks | © ngelinux.com | 11/12/2026
