The File Allocation Table - FAT - FAT32
The File Allocation Table of contents of a computer disk which tells what sectors are used for what file. The File Allocation Table ( also know as FAT, FAT16, and FAT32 ), is located in the master boot sector (first 63) of a bootable disk, floppy or hard. You visually cannot see this. The FAT follows the boot sector.
The FAT file system revolves around the File Allocation Table for which it is named. Each logical volume has its own FAT, which serves two important functions: it contains the allocation information for each file on the volume in the form of linked lists of allocation units and it indicates which allocation units are free for assignment to a file that is being created or extended.
The File Allocation Table ( FAT ) was designed and coded in Feb., 1976 by a kid named Bill Gates during a five day stay at the Hilton Hotel in Albuquerque. He developed it for a version of Basic that could store programs and data on floppy disks. The FAT design was incorporated by Tim Patterson in an early version of an operating system for the Intel 8086 chip. Gates bought the rights to the system, then rewrote it to create the first version of DOS. As a direct result, Gates is the richest man in America.
The FAT file system is simple and reliable. It does not lose data because the computer crashed in the middle of an update. It does not use a lot of memory. It does, however, do a lot of extra administrative I/O to different areas of the partition. The directory is allocated at the start of the partition and it contains the table of free space. To write a new data set, or to add data to an old one, the disk arm must be constantly moved between the location of the directory and the place where the data is being written. Without optimization, a file can end up fragmented into many small pieces.
When the system crashes, no data is lost. However, a FAT system may have removed disk area from the chain of free space, but may not have yet assigned it to any permanent new data set. The CHKDSK or SCANDISK utility examines the FAT table to determine the status of every record on disk. The records which are not part of any data set may be returned to the free space chain.
After CHKDSK finds unallocated sectors, it asks you whether they should be turned into files. If you were in the middle of creating a new file and the system crashed, and the data that was lost is extremely valuable, you might answer Yes. If you do answer Yes you can scan the recovered file scraps for the information you lost. Otherwise, answer No and the unallocated space will be recycled as free space.
If the FAT table (Table 1) becomes corrupted, or what is known as disk errors, there is a second (backup) table (Table 2) available for programs like Scandisk uses to fix the FAT (Table 1). A corrupt FAT can cause you to get the message "No Bootable Media". At this point if Scandisk cannot fix it you will need to format and start over. It is recommended that you Low Level Format and reinstall Windows. If the Windows Setup program complains about the drive, replace the drive with a new one.
By design FAT supports a maximum of 64K allocation units . When the disk partition is 32 megabytes or less, an allocation unit is a 512 byte sector. However, as the disk gets larger, the units get larger. A 64 megabyte disk partition has 1K allocation units. A 128 meg partition has 2K units. A 256 meg partition has 4K allocation units. Each file occupies one or more allocation unit. As the allocation units get larger, any large number of small files wastes a lot of disk space.
The classical FAT directory structure (before NT and Windows 95) limits file names to eight characters with a three character extension (as in the name "AUTOEXEC.BAT"). This 8.3 naming convention was borrowed from earlier DEC minicomputers. The FAT structure also maintains for each file a set of attributes, S H R A (is it a System data set, should it be Hidden in the DIR display, should it be Archived next time the disk is backed up, is it Read-only). There is also a data and time stamp when the file was last changed.
OS/2 allows a FAT file to have additional Extended Attributes. Since there is no room for these attributes in the FAT directory, OS/2 creates a separate hidden file on the disk volume named "EA DATA. SF" and stores the information there.
FAT has been around for a long time, so its problems have been carefully studied. Every version of DOS and Windows (except NT) comes with a DEFRAG program that will reorganize the directory, files, and free space to maximize performance. Effective use of RAM as a disk cache can address some of the I/O problems. Our QikFix program has a Memory Utilization program to help optimize the swap file and a Cache utility to optimize the disk cache.
If you want to learn more about FAT and are more advanced then what this page covers, it is very in-depth about FAT and well written. I discovered http://www.storagereview.com/guide2000/ref/hdd/file/fat.html about a year or two after I wrote the above page.