commands

fstrim — Discard unused blocks

Request discard on supported mounted storage; dry-run skips the FITRIM ioctl. This is not a repair or secure erase. Use a fresh private workspace; live operations are VM-only.

Formal Syntax & Structure

linux syntaxlinux
fstrim --dry-run MOUNTPOINT

Parameters & Attributes

NameTypeDescription
--dry-runoptionDo not issue FITRIM
MOUNTPOINToperandAuthorized mount

Return Value

exit status and output

Dry-run skips the discard ioctl; output or status reflects the attempted dry-run workflow, not discarded bytes. Consult installed util-linux behavior for unsupported mounts and do not infer real trim success.

Working Example

Example Snippetlinux
fstrim --help
Linux Reference