OS Manuals

/usr/bin/fstrim

File system trim from util-linux

From fstrim 2.42.4-r2 (os), captured 2026-11-05 by running fstrim --help (exit 0). permalink

Usage:
 fstrim [options] -A|-a|<mountpoint>

Discard unused blocks on a mounted filesystem.

Options:
 -a, --all                trim mounted filesystems
 -A, --fstab              trim filesystems from /etc/fstab
 -I, --listed-in <list>   trim filesystems listed in specified files
 -o, --offset <num>       the offset in bytes to start discarding from
 -l, --length <num>       the number of bytes to discard
 -m, --minimum <num>      the minimum extent length to discard
 -t, --types <list>       limit the set of filesystem types
 -v, --verbose            print number of discarded bytes
     --quiet-unsupported  suppress error messages if trim unsupported
 -n, --dry-run            does everything, but trim

 -h, --help          display this help
 -V, --version       display version

Arguments:
 Values for <num> may be followed by a suffix: KiB, MiB,
 GiB, TiB, PiB, EiB, ZiB, or YiB (where the "iB" is optional).

For more details see fstrim(8).
Options (12)
OptionDescriptionSource
-a, --allTrim all mounted filesystems on devices that support the discard operation.help + man
-A, --fstabTrim all mounted filesystems mentioned in /etc/fstab on devices that support the discard operation.help + man
-I, --listed-in listSpecifies a colon-separated list of files in fstab or kernel mountinfo format.help + man
-o, --offset numByte offset in the filesystem from which to begin searching for free blocks to discard.help + man
-l, --length numThe number of bytes (after the starting point) to search for free blocks to discard.help + man
-m, --minimum numMinimum contiguous free range to discard, in bytes.help + man
-t, --types listSpecifies allowed or forbidden filesystem types when used with --all or --fstab.help + man
-v, --verboseprint number of discarded byteshelp + man
--quiet-unsupportedSuppress error messages if trim operation (ioctl) is unsupported.help + man
-n, --dry-runThis option does everything apart from actually call FITRIM ioctl.help + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man
Exit status (4) from the manual page
0success
1failure
32all failed
64some filesystem discards have succeeded, some failed

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.