discard · shipping

Discard

A block-storage request indicating that specified logical ranges are no longer needed by the caller.

Linux discard is a storage-stack operation, not a synonym for one wire command. Filesystem-aware fstrim selects unused blocks; direct blkdiscard acts on device ranges and can destroy live data. [1] [2]

Process success alone is insufficient: --dry-run omits FITRIM; --all or --fstab silently ignore specified unsupported/read-only errors; --quiet-unsupported clears unsupported-filesystem failure status. A verbose fstrim byte count describes potential discard, not newly reclaimed physical space, and repeated runs can report the same ranges. With no_discard_passdown, dm-thin removes mappings without forwarding discards to the underlying data device; ignore_discard disables discard support instead. Passdown enabled at table load can be disabled if the backing device lacks support; inspect pool status. Mapping removal and physical-device deallocation are distinct outcomes. [1] [5]

Linux reports discard granularity and hardware/software request-size limits. Support at one layer is not proof that a request reaches the final device. Encrypted dm-crypt mappings ignore discard by default; allow_discards enables forwarding, which may reveal allocation patterns when discarded ranges remain identifiable. The documented warning concerns allocation-pattern leakage, not a general confidentiality guarantee. [6] [4]

Relations

related
TRIM, SCSI UNMAP, NVMe, UNMAP, Thin provisioning, Deallocated read behavior, dm-crypt, FITRIM

Advantages

  • A minimum free-extent length can skip fragmented free space to reduce the work of a filesystem trim. [1]

Limitations

  • Zero-filling and secure discard are separate blkdiscard operations; ordinary discard proves neither. [2]

Citations

  1. util-linux 2.41.2: fstrim manual, verbose output (accessed 2026-10-21)
  2. util-linux 2.41.2: blkdiscard manual (accessed 2026-10-11)
  3. Linux v6.12: dm-crypt, encryption target, integrity metadata and allow_discards (accessed 2026-10-21)
  4. Linux v6.12: thin provisioning, ignore_discard and no_discard_passdown (accessed 2026-10-21)
  5. Linux v6.12: stable sysfs block ABI, discard granularity and request limits (accessed 2026-10-18)

Further reading

  1. Hesela: Discard is not zeroing (accessed 2026-10-11)

JSON: /data/terms/discard.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Discard. Hesela. 2026-11-08. https://hesela.dev/terms/discard/