{
  "slug": "file-preallocation",
  "term": "File preallocation",
  "aliases": [
    "file space reservation"
  ],
  "definition": "Reserving filesystem allocation for a file range before the application writes that range's data.",
  "note": "Successful Linux fallocate with mode 0 protects subsequent writes in the allocated range against lack of filesystem space; KEEP_SIZE avoids extending logical length. This is not just an advisory hint. A lower thin pool can still require backing allocations when data is written: an end-to-end capacity reservation is not established by the file operation alone, an inference from the separate layer contracts. Shared extents need an explicit sharing-aware contract; FALLOC_FL_UNSHARE_RANGE can make them private where supported.",
  "status": "shipping",
  "advantages": [
    {
      "text": "Reserves a selected range before later application writes need its filesystem allocation.",
      "citationIds": [
        "fallocate"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Allocation is not proof that future application data has been persisted.",
      "citationIds": [
        "util-fallocate"
      ]
    },
    {
      "text": "The fallocate interface also has deallocation and zeroing modes, so the API name alone does not identify preallocation.",
      "citationIds": [
        "fallocate"
      ]
    }
  ],
  "related": [
    "sparse-file",
    "hole-punching",
    "thin-provisioning",
    "fsync",
    "file-extent",
    "unwritten-extent",
    "reflink"
  ],
  "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": "util-fallocate",
      "title": "util-linux 2.41.2: fallocate(1), preallocation, punching and zeroing",
      "url": "https://raw.githubusercontent.com/util-linux/util-linux/v2.41.2/sys-utils/fallocate.1.adoc",
      "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": "hesela-allocation",
      "title": "Sparse files, preallocation and thin-pool capacity",
      "url": "https://hesela.com/analyses/sparse-files-preallocation-thin-capacity/",
      "accessed": "2026-10-13"
    }
  ]
}
