MS-DOS 6.22 Disk Cluster Allocation for Small Files
In MS-DOS 6.22, disk storage is managed using the FAT (File Allocation Table) file system, typically FAT16 for hard drives or FAT12 for floppy disks. When handling very small files, MS-DOS 6.22 allocates storage strictly in units called clusters, meaning even a single-byte file consumes an entire cluster of disk space, with the exception of zero-byte files which occupy none. Because MS-DOS 6.22 cannot divide a cluster among multiple files or store data directly in directory entries, saving small files on large partitions results in substantial wasted storage known as internal fragmentation or slack space.
The Role of the Cluster as the Minimum Allocation Unit
Under MS-DOS 6.22, the operating system does not write directly to individual 512-byte physical disk sectors. Instead, it groups sectors into logical units called clusters (or allocation units). The cluster is the smallest addressable unit of file storage that the FAT file system can allocate. A cluster cannot be shared between multiple files under any circumstances; once assigned, it belongs exclusively to that specific file until deleted or resized.
Allocation for Zero-Byte Files
If a file has a size of zero bytes, MS-DOS 6.22 creates an entry for it in the directory table, recording the filename, extension, attributes, timestamps, and a file size of 0. However, the operating system sets the starting cluster pointer in the directory entry to 0. No entry in the File Allocation Table is marked as used, and no physical disk clusters are reserved. The file exists solely as metadata within the 32-byte directory entry.
Allocation for Files from 1 Byte Up to Cluster Capacity
When a file contains any data—even a single character (1 byte)—MS-DOS 6.22 must assign physical storage to it:
- Directory Entry: The operating system writes a standard 32-byte directory record containing the file metadata, the actual file size in bytes, and the address of the first allocated cluster.
- FAT Table Entry: The operating system searches the
File Allocation Table for the first available (free) cluster. It marks
this cluster number with an End-of-File (EOF) marker (typically
0xFFFFin FAT16). Because the file fits entirely within that single cluster, no cluster chaining occurs. - Sector Write: MS-DOS writes the file's data into the first sector of that allocated cluster. The remaining sectors within that cluster remain physically unwritten or retain leftover remnant data, but the operating system considers the entire cluster unavailable for any other file.
Slack Space and FAT16 Cluster Sizes
Because FAT16 is limited to 65,526 total clusters, larger partition sizes force MS-DOS 6.22 to use larger cluster sizes to format the partition. The default cluster sizes in MS-DOS 6.22 for FAT16 partitions are:
- 16 MB to 127 MB: 2 KB clusters (4 sectors)
- 128 MB to 255 MB: 4 KB clusters (8 sectors)
- 256 MB to 511 MB: 8 KB clusters (16 sectors)
- 512 MB to 1,023 MB: 16 KB clusters (32 sectors)
- 1,024 MB to 2,048 MB: 32 KB clusters (64 sectors)
On a standard 2 GB FAT16 partition, a 32 KB cluster size is mandatory. If an application creates a text file containing only 10 bytes of text, MS-DOS 6.22 reserves the entire 32,768-byte cluster for that file. The unused 32,758 bytes constitute "slack space." This space cannot be retrieved or allocated to any other file, leading to significant storage inefficiency when managing large numbers of small files.
Absence of Advanced File System Features
Modern file systems mitigate this issue using techniques such as tail packing, block sub-allocation, or storing tiny files directly inside file system metadata structures (such as resident files in NTFS MFT records). MS-DOS 6.22 includes none of these mechanisms. The FAT architecture requires a one-to-one mapping between the File Allocation Table index and physical disk clusters, restricting MS-DOS 6.22 to allocating whole clusters regardless of how small the payload is.