Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop your SSD from turning into a slug
đź§© The Challenge
You ever notice your database server getting sluggish after a few months of heavy writes? It’s usually because the drive has no idea which blocks are actually free, so it’s busy shuffling garbage around instead of writing your data.
đź’ˇ The Fix
Run a discard operation to tell the drive controller which blocks aren’t needed anymore. It clears out the clutter and brings back that snappy performance you had when the box was fresh out of the rack.
fstrim -av
⚙️ Why It Works
This utility walks the filesystem and punches a hole in the logical block map, essentially telling the SSD’s firmware that those sectors are fair game for internal garbage collection. Most distros should have a systemd timer for this, but if your setup is ancient or custom, you’ll want to manually verify it’s actually running.
🚀 Pro-Tip: Stick this in your root crontab as a weekly job if your distro didn’t set up the timer for you.
Linux Tips & Tricks | © ngelinux.com | 9/7/2026
