fstrim
fstrim is a util-linux command that asks mounted filesystems to discard unused extents through the Linux FITRIM ioctl.
The command, FITRIM interface and ATA TRIM operation are separate concepts. In v2.41.2, --all and --fstab select eligible mounted filesystems; --listed-in uses the first nonempty table, not their union. [1]
A successful exit does not establish complete coverage. Batch mode excludes some targets and does not count unsupported results as failures; --quiet-unsupported also normalizes a single-target unsupported result. [2]
Dry-run omits FITRIM. Verbose byte counts are potential discard, not unique physical reclamation or sanitization. [1]
For monitoring, retain the intended inventory, selection rules, per-target outcomes and software version separately.
A synthetic outcome model separates aggregate exit status from successful FITRIM calls; it does not execute fstrim. [3]
Relations
- related
- FITRIM, Discard, TRIM, Thin provisioning
Advantages
- Filesystem-aware selection avoids treating arbitrary device ranges as unused. [1]
Limitations
- Exit status alone cannot distinguish successful trimming from skipped or unsupported coverage. [2]
Citations
- util-linux v2.41.2: fstrim selection, dry-run and reporting
- util-linux v2.41.2: fstrim_filesystem, fstrim_all_from_file, fstrim_all and main
- Hesela: executable fstrim batch-outcome illustration
Sources & caveats
- Source-grounded utility identity; does not rename or change the existing FITRIM or TRIM identifiers. No ioctl, discard operation or hardware measurement was performed.