{
  "slug": "hole-punching",
  "term": "Hole punching",
  "aliases": [
    "file hole punching"
  ],
  "definition": "Deallocating whole filesystem blocks within a file range while preserving the file's logical length and making the affected range read as zeros.",
  "note": "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.",
  "status": "shipping",
  "advantages": [
    {
      "text": "Can release whole blocks in a selected range without shortening the file.",
      "citationIds": [
        "fallocate"
      ]
    }
  ],
  "limitations": [
    {
      "text": "A partial-block range need not release any whole filesystem block.",
      "citationIds": [
        "fallocate"
      ]
    },
    {
      "text": "File-level deallocation does not prove immediate physical reclamation below a thin pool.",
      "citationIds": [
        "lvmthin",
        "dm-thin"
      ]
    }
  ],
  "related": [
    "sparse-file",
    "file-preallocation",
    "discard",
    "thin-provisioning",
    "unwritten-extent"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-13",
  "citations": [
    {
      "id": "fallocate",
      "title": "Linux man-pages: fallocate(2), allocation and mode contracts",
      "url": "https://www.man7.org/linux/man-pages/man2/fallocate.2.html",
      "accessed": "2026-10-12"
    },
    {
      "id": "lvmthin",
      "title": "LVM2: lvmthin(7), physical allocation, discards and pool exhaustion",
      "url": "https://man7.org/linux/man-pages/man7/lvmthin.7.html",
      "accessed": "2026-10-12"
    },
    {
      "id": "dm-thin",
      "title": "Linux 6.12: device-mapper thin provisioning, metadata and exhaustion",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.12/Documentation/admin-guide/device-mapper/thin-provisioning.rst",
      "accessed": "2026-10-12"
    },
    {
      "id": "hesela-allocation",
      "title": "Sparse files, preallocation and thin-pool capacity",
      "url": "https://hesela.com/analyses/sparse-files-preallocation-thin-capacity/",
      "accessed": "2026-10-13"
    }
  ]
}
