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
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]