Run fstrim to keep your SSD fast

Trim unused blocks on SSDs so writes stay fast and the drive wears evenly.

LinuxssdstoragedisktrimMedium risk
Run sudo fstrim -av to TRIM every mounted SSD now, or enable the weekly timer with sudo systemctl enable --now fstrim.timer.

01Command

Command
$ sudo fstrim -av

02What it does

SSDs cannot overwrite data in place; the drive only reclaims deleted blocks when the OS tells it which ones are free. fstrim passes that list to the drive, keeping write speed and longevity close to factory levels. Most modern distros ship a weekly fstrim.timer, so enabling it once is all a normal desktop needs.

03Risk

RiskMedium risk
RequirementsSSD or NVMe drive; root access. On Ubuntu/Debian/Arch the weekly fstrim.timer usually exists already and only needs enabling.
!Warning: Run fstrim only on SSDs, not on HDDs. Avoid old advice about a daily cron TRIM — weekly is enough, and trimming is a long-lasting operation on nearly full drives, so don't interrupt it.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Solid state drive - ArchWiki
    Arch Wiki · community · 2026-09-17
    Evidence: Documents fstrim.timer as the recommended periodic TRIM mechanism for SSDs.
  • fstrim(8) — Arch Manual Pages
    Arch Linux · community · 2026-09-17
    Evidence: fstrim [-v] [-o offset] ... and the --all/--verbose flags are documented; the page notes fstrim discards unused blocks on a mounted filesystem.

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions