1. When to use it
Useful on SSD-based hosts where you want simple and controllable periodic maintenance.
fstrim | SSD | discard | cron | trim
2. Base setup
fstrim -av
grep -n discard /etc/fstab
crontab -l
Adjust host names, IPs, interfaces, paths, and versions to the real system before making the change persistent.
3. Quick verification
lsblk --discard
grep -R fstrim /etc/cron* 2>/dev/null
mount | grep ' / '
Confirm that the output matches the expected state before considering the intervention complete.
4. Operational notes
For many workloads periodic trim is enough; continuous discard only makes sense when you have a specific reason.
Quick checklist
[ ] Steps completed\n[ ] Config updated\n[ ] Tests executed\n[ ] Rollback ready\n[ ] Logs checked