Home |
Sectors, Sector Addressing, and Clusters Logical Drives and Partition Tables The File Allocation Table and Cluster Sizes The ISO 9660 File System Structure The exFAT File System Structure |
The File Allocation Table and Cluster SizesThe FAT follows the boot record. The FAT is a linked list of clusters, where each cluster chain represents a file. For example, if file C:\SOMEDIR\SOMEFILE.DAT resides in cluster 100, 101, 102, and 110, then the 100th integer value in the FAT has value 101. This means that the next cluster of this file is cluster number 101. The value found at 101 will be 102. At 102, value 110 is found. Cluster 110 is the last cluster of file, so an end-of-file marker is found there. A volume's unused space is not linked in the FAT. Instead, its space is marked with value 0. Microsoft has defined three different FAT types: FAT-12, FAT-16, and FAT-32. With FAT-12 (used mostly on diskettes), each FAT entry has a size of 12 bits. Thus, it can handle only about 4096 (minus a few reserved values) clusters. FAT-16 uses 16 bits to represent a cluster and consequently supports up to about 65536 clusters, while FAT-32 allocates 28 bits per cluster value. Since the number of available clusters is limited, large disks require larger cluster sizes. A cluster size must be a power of two. The maximum cluster size supported by DOS and 16-bit Windows is 64 sectors or 32k bytes. Windows NT and later support cluster sizes up to 128 sectors. RTFiles-32 also supports extended cluster sizes up to 32768 sectors (16M bytes) which are particularity well suited for volumes to store very large files. Some formatting programs allow the cluster size to be specified. In this case, the user must decide whether he prefers large clusters (and thus a small number of total clusters) or a large number of small clusters. If a volume will host many small files, a small cluster size should be selected to minimize the amount of space wasted in unused portions of the last cluster allocated to each file. Formatting with few large clusters is advantageous for volumes that should hold large files. The total size of the FAT depends on the number of available clusters and will therefore be small on such a volume, reducing the amount of housekeeping data the file system software has to maintain. MS-DOS will usually format a drive to hold two copies of the FAT. The second copy is maintained as a backup copy for disk repair utilities. If the primary FAT gets corrupted, a disk repair program can copy the secondary FAT onto the primary FAT. The file system software itself will never actually use the second FAT. Thus, the second FAT can improve security, but it always incurs a performance penalty because each FAT update requires twice as many disk write operations as it would for a single FAT volume. It should also be noted that the added security is limited. Many errors will cause both FATs to be corrupted (example: the program terminates abnormally while unflushed data is cached). To improve performance, RTFiles-32 has an option not to maintain the second copy of the FAT. However, by default, both FATs are updated. RTFiles-32 can also format disks to hold only a single FAT.
|