AlgoMaster Logo

File Allocation and Extents

Low Priority35 min readUpdated August 14, 2026

A database file presents one logical byte sequence:

The storage underneath does not have to contain one continuous 10 GiB region reserved from the beginning. The file may grow over time, occupy several separated runs, and contain logical gaps that consume no data blocks.

The file system is responsible for connecting the two views:

This responsibility is file allocation.

File allocation decides which file-system blocks represent each allocated part of a file and records the mapping from logical offsets to those blocks.

Modern file systems commonly describe contiguous runs with extents. One extent can map many logical blocks with a compact (logical start, storage start, length) record.

This chapter compares classic allocation strategies and modern extents, explains sparse files, free-space tracking, locality, preallocation, delayed allocation, fragmentation, defragmentation, and the difference between logical and allocated size.

Premium Content

Subscribe to unlock full access to this content and more premium articles.