Technical information
© Jean Louis-Guérin – V1.2a – September 2014 Page 57 / 69
0x1FE
2
Boot sector signature (0x55 0xAA)
10.6.2 FS Information Sector
The FS Information Sector was introduced in FAT32 for speeding up access times of certain
operations (in particular, getting the amount of free space). It is located at a sector number specified in
the boot record at position 0x30 (usually sector 1, immediately after the boot record).
Offset
Length
Description
0x00
4
FS information sector signature (0x52 0x52 0x61 0x41 / "RRaA")
0x04
480
Reserved (byte values are 0x00)
0x1e4
4
FS information sector signature (0x72 0x72 0x41 0x61 / "rrAa")
0x1e8
4
Number of free clusters on the drive, or -1 if unknown
0x1ec
4
Number of the most recently allocated cluster
0x1f0
14
Reserved (byte values are 0x00)
0x1fe
2
FS information sector signature (0x55 0xAA)
10.6.3 DOS/FAT File Allocation Table
A partition is divided up into identically sized clusters, small blocks of contiguous space. Cluster sizes
vary depending on the type of FAT file system being used and the size of the partition, typically cluster
sizes lie somewhere between 2 KB and 32 KB. Each file may occupy one or more of these clusters
depending on its size; thus, a file is represented by a chain of these clusters (referred to as a singly
linked list). However these clusters are not necessarily stored adjacent to one another on the disk's
surface but are often instead fragmented throughout the Data Region.
The file allocation table (FAT) is a list of entries that map to each cluster on the partition. Each entry
records one of five things:
The cluster number of the next cluster in a chain
A special end of cluster chain (EOC) entry that indicates the end of a chain
A special entry to mark a bad cluster
A special entry to mark a reserved cluster
A zero to note that the cluster is unused
Each version of the FAT file system uses a different size for FAT entries. Smaller numbers result in a
smaller FAT table, but waste space in large partitions by needing to allocate in large clusters. The
FAT12 file system uses 12 bits per FAT entry, thus two entries span 3 bytes. It is consistently little-
endian: if you consider the 3 bytes as one little-endian 24-bit number, the 12 least significant bits are
the first entry and the 12 most significant bits are the second. In the FAT32 file system, FAT entries
are 32 bits, but only 28 of these are actually used; the 4 most significant bits are reserved.
FAT entry values:
FAT12
FAT16
FAT32
Description
0x000
0x0000
0x00000000
Free Cluster
0x001
0x0001
0x00000001
Reserved value; do not use
0x002–0xFEF
0x0002–0xFFEF
0x00000002–0x0FFFFFEF
Used cluster; value points to next cluster
0xFF0–0xFF6
0xFFF0–0xFFF6
0x0FFFFFF0–0x0FFFFFF6
Reserved values; do not use.
0xFF7
0xFFF7
0x0FFFFFF7
Bad sector in cluster or reserved cluster
0xFF8–0xFFF
0xFFF8–0xFFFF
0x0FFFFFF8–0x0FFFFFFF
Last cluster in file
Note that FAT32 uses only 28 bits of the 32 possible bits. The upper 4 bits are usually zero (as
indicated in the table above) but are reserved and should be left untouched.
The first cluster of the Data Region is cluster #2. That leaves the first two entries of the FAT unused. In
the first byte of the first entry a copy of the media descriptor is stored (usually 0xF8). The remaining 8
bits (if FAT16) or 20 bits (if FAT32) of this entry are set to 1. In the second entry the end-of-cluster-
chain marker is stored. The high order two bits of the second entry are sometimes, in the case of