Interview Prep/Linux/Disk, Capacity & Backups

What is TRIM/discard and how should it be configured?

AdvancedProductionDisk, Capacity & Backups
Answer

TRIM tells SSDs (and thin-provisioned storage) which blocks are no longer in use, preserving performance and reclaiming space on thin volumes. Mounting with discard issues TRIM synchronously on every delete, which can add latency. The common practice is periodic batched TRIM:

sudo systemctl enable --now fstrim.timer   # weekly
sudo fstrim -av

For LVM thin pools, also set issue_discards/thin_pool_discards appropriately.

All Linux questions Roadmap: Linux

More on Disk, Capacity & Backups