Filesystem allocation unit
A filesystem allocation unit is a granularity at which a filesystem allocator reserves storage space, with the unit and rules depending on the format.
In exFAT, a cluster consists of one or more consecutive volume sectors; its byte size follows from the sector-size and sectors-per-cluster fields. Allocation state is tracked per cluster. [1]
An allocation unit need not equal a filesystem block. Ext4 bigalloc allocates clusters containing multiple blocks, without changing the block-addressed layout. A larger cluster makes allocation coarser, not the drive's logical sectors larger. [2]
Allocation can also be finer than a block. FreeBSD newfs exposes separate block and fragment sizes for UFS1/UFS2, permitting power-of-two fragment sizes from one eighth of a block up to a whole block. A cluster is not a universal name for the smallest allocation unit. [5]
Allocation granularity alone does not determine a file's total storage cost: ext4 inline data can live inside an inode without a separate data block. Likewise, a volume's logical cluster number is not a guaranteed physical HDD-sector location. [3] [4]
In the historical Berkeley FFS design, extending a fragment-backed tail can allocate new space and copy the existing tail. Repeated small extensions can repeat that work. Final allocation size alone does not reveal this copying history; this is not a NAND write-amplification measurement. [6]
Filesystem geometry and reporting units are distinct. For statvfs, f_blocks, f_bfree and f_bavail are counted in f_frsize units; the API does not guarantee meaningful values for every field on every filesystem. This is a filesystem report, not a per-file allocation map. [7]
Relations
- related
- Filesystem block, ext4 bigalloc, exFAT, Logical sector, Physical sector, Allocation bitmap, File extent, statvfs
Limitations
Citations
- Microsoft exFAT specification: sections 3.1.14, 3.1.15, 5.1 and 7.1.5
- Linux kernel documentation: ext4 clustered allocation
- Linux kernel documentation: ext4 inline data
- Microsoft: clusters and extents, VCN/LCN and physical-mapping limits
- FreeBSD newfs(8): separate block-size and fragment-size parameters
- McKusick, Joy, Leffler and Fabry. A Fast File System for UNIX. ACM TOCS 2(3), 1984, section 3.1, pp. 186-187.
- Linux man-pages: statvfs(3), block-counter units and field-availability limits
Sources & caveats
- Filesystem-level definition synthesized from ext4, exFAT and FreeBSD documentation; no universal file-allocation formula or device performance result is claimed.
- The atomicity and durability limitation is an engineering inference: allocation geometry alone specifies no completion or persistence contract.