When a file is created or extended, MS-DOS assigns it groups of disk sectors from the files area in powers of 2. These are known as allocation units or clusters. The number of sectors per cluster for a given medium is defined in the BPB and can be found at offset 0DH in the disk's boot sector. Below are some example cluster sizes:
Disk type Power of 2 Sectors/cluster
5.25" 180 KB floppy disk 0 1
5.25" 360 KB floppy disk 1 2
PC/AT fixed disk 2 4
PC/XT fixed disk 3 8
The file allocation table (FAT) is divided into fields that correspond directly to the assignable clusters on the disk. These fields are 12 bits in MS-DOS versions 1 and 2 and may be either 12 bits or 16 bits in versions 3.0 and later, depending on the size of the medium (12 bits if the disk contains fewer than 4087 clusters, 16 bits otherwise).
The first two fields in the FAT are always reserved. On IBM-compatible media, the first 8 bits of the first reserved FAT entry contain a copy of the media descriptor byte, which is also found in the BPB in the boot sector. The second, third, and (if applicable) fourth bytes, which constitute the remainder of the first two reserved FAT fields, always contain 0FFH. The currently defined IBM-format media descriptor bytes are as follows:
MS-DOS version where first
Descriptor Medium supported
0F0H 3.5" floppy disk, 2-sided, 18-sector 3.3
0F8H Fixed disk 2.0
0F9H 5.25" floppy disk, 2-sided, 15-sector 3.0
3.5" floppy disk, 2-sided, 9-sector 3.2
0FCH 5.25" floppy disk, 1-sided, 9-sector 2.0
0FDH 5.25" floppy disk, 2-sided, 9-sector 2.0
8" floppy disk, 1-sided, single-density
0FEH 5.25" floppy disk, 1-sided, 8-sector 1.0
8" floppy disk, 1-sided, single-density
8" floppy disk, 2-sided, double-density
0FFH 5.25" floppy disk, 2-sided, 8-sector 1.1
The remainder of the FAT entries describe the use of their corresponding disk clusters. The contents of the FAT fields are interpreted as follows:
Value Meaning
(0)000H Cluster available
(F)FF0—(F)FF6H Reserved cluster
(F)FF7H Bad cluster, if not part of chain
(F)FF8—(F)FFFH Last cluster of file
(X)XXX Next cluster in file
Each file's entry in a directory contains the number of the first cluster assigned to that file, which is used as an entry point into the FAT. From the entry point on, each FAT slot contains the cluster number of the next cluster in the file, until a last-cluster mark is encountered.
At the computer manufacturer's option, MS-DOS can maintain two or more identical copies of the FAT on each volume. MS-DOS updates all copies simultaneously whenever files are extended or the directory is modified. If access to a sector in a FAT fails due to a read error, MS-DOS tries the other copies until a successful disk read is obtained or all copies are exhausted. Thus, if one copy of the FAT becomes unreadable due to wear or a software accident, the other copies may still make it possible to salvage the files on the disk. As part of its procedure for checking the integrity of a disk, the CHKDSK program compares the multiple copies (usually two) of the FAT to make sure they are all readable and consistent.