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
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
- Linux man-pages: fallocate(2), allocation and mode contracts
- LVM2: lvmthin(7), physical allocation, discards and pool exhaustion
- Linux 6.12: device-mapper thin provisioning, metadata and exhaustion