hole-punching · shipping · also file hole punching

Hole punching

Deallocating whole filesystem blocks within a file range while preserving the file's logical length and making the affected range read as zeros.

On Linux, FALLOC_FL_PUNCH_HOLE must be combined with FALLOC_FL_KEEP_SIZE; partial boundary blocks are zeroed rather than removed. The operation changes file content and requires filesystem support. It is not the same as collapsing a range, which shifts later data, or as a sanitization procedure.

Relations

related
Sparse file, File preallocation, Discard, Thin provisioning, Unwritten extent, MADV_REMOVE

Advantages

  • Can release whole blocks in a selected range without shortening the file. [1]

Limitations

  • A partial-block range need not release any whole filesystem block. [1]
  • File-level deallocation does not prove immediate physical reclamation below a thin pool. [2, 3]

Citations

  1. Linux man-pages: fallocate(2), allocation and mode contracts (accessed 2026-10-12)
  2. LVM2: lvmthin(7), physical allocation, discards and pool exhaustion (accessed 2026-10-12)
  3. Linux 6.12: device-mapper thin provisioning, metadata and exhaustion (accessed 2026-10-12)

Further reading

  1. Sparse files, preallocation and thin-pool capacity (accessed 2026-10-13)

JSON: /data/terms/hole-punching.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Hole punching. Hesela. 2026-11-09. https://hesela.dev/terms/hole-punching/