Discard unused blocks on mounted SSD-backed filesystems.
Section: Troubleshooting
Trim mounted SSD filesystems
bash
bash
sudo fstrim -avExplanation
Discard unused blocks on mounted SSD-backed filesystems.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Troubleshooting
Show disk throughput and utilization
Inspect per-device read/write rates and utilization over time.
Watch per-process I/O usage
Find which processes generate the most disk I/O.
Show per-process I/O counters
Track read/write activity by process over time.
Show system-wide I/O wait and block activity
Quick check for iowait, swap, and block device pressure.
Filter kernel logs for storage messages
Look for hardware and filesystem errors in kernel logs.
Search journal for disk errors
Kernel journal view for storage-related problems.