What is File Allocation Table (FAT)?


File Allocation Table (FAT) is a file system that was developed by Microsoft to support small disks and simple folder structures. The file system is named File Allocation Table because it uses a table to track the clusters on a storage volume, as well as how those clusters are linked together through their associated files and directories. Because of the table’s important role, the acronym FAT is sometimes used to refer to the table itself, rather than the file system, although it’s not uncommon to see it used both ways in a single resource.

Fille allocation table history and versions

The FAT file system got its start with the introduction of MS-DOS, or Microsoft Disk Operating System, and is still in use today, but it has evolved over the years to accommodate growing data volumes. During that time, there have been multiple versions of the file system. The original version was FAT8, followed by FAT12, then FAT16, FAT32 and — finally — exFAT. The two versions commonly seen today are FAT16, often shown as just FAT, and FAT32.

The number associated with each FAT version (e.g., FAT16) refers to the number of bits that are used for each entry in the allocation table. For example, an allocation table entry for a FAT16 volume is 16 bits long. However, it’s not just the number of entry bits that differentiates the FAT versions. Each version also supports larger volumes and file sizes than its predecessor. Even so, FAT is still limited to small-scale storage compared with more modern file systems. The largest file size FAT32 can support is 4 GB, and the largest volume size is 2 TB.

At one time, the FAT file system was used extensively for Windows computers. However, today, most Windows systems use the New Technology File System (NTFS) — or, to a lesser degree, the Resilient File System (ReFS), which Microsoft introduced in 2012 promising to support greater availability, resiliency and scalability.

Windows Disk Management menu showing file system settings including NTFS.
Although Windows 10 and 11 still support FAT, they use NTFS by default, and ReFS to a lesser extent.

Although the FAT system has been superseded on most Windows computers, current Windows editions still support FAT, as do macOS, Linux and Unix. In addition, FAT is still used for floppy disks, USB flash drives and storage media in smaller, portable devices such as digital cameras.

Microsoft has released Extensible File Allocation Table (exFAT), which is designed to support flash memory devices. The exFAT system supports extremely large file and volume sizes, files up to 16 exabytes and volumes 128 petabytes. It is the default volume type for modern memory cards, as it allows for large file storage while still being simple to read and write to. Without exFAT, digital video cameras would need to split their video files into 4 GB segments.

What is the function of File Allocation Table?

FAT plays a pivotal role in facilitating file and directory access on a FAT volume and is directly integrated into the volume’s layout. A FAT volume is organized into multiple sections that follow a prescribed order, starting with the boot sector:

  • Boot sector. Stores the information needed by the file system to access the volume, including the volume’s layout and file system structure.
  • Allocation table region. Stores the primary allocation table, as well as a duplicate of the table that serves as a backup in case the primary table cannot be accessed.
  • Root directory. Stores a directory table containing entries that describe the files and folders stored on the volume. Each entry includes information such as name, size, created date and last modified date. An entry also includes the starting cluster number, which corresponds to an entry in the file allocation table. For FAT12 and FAT16, the root directory exists at a specified location on the storage media — right after the allocation tables — and has a fixed number of maximum entries. The root directory for FAT32 is maintained in the data region and does not have a fixed number of maximum entries.
  • Data region. Stores the actual file and directory data. This area is divided into clusters that make up the bulk of the volume. The clusters are numbered sequentially and correspond to the listings in the allocation table.

Clusters are the basic units of logical storage on a FAT volume. A cluster can range in size from 512 bytes to 64 KB, depending on volume size and type of FAT file system. Each file written to a FAT volume is stored in one or more clusters, with each cluster available to only one file at a time. A file’s clusters might be adjacent to each other in consecutive order or be scattered across the volume, resulting in a fragmented file.

The allocation table on a FAT volume tracks each cluster in that volume, mapping the allocation chains associated with the volume’s directories and files. Each table entry corresponds to a cluster and is typically in one of four states:

  • The cluster is unused.
  • The cluster is in an allocation chain associated with a specific file or directory; the table entry references the next cluster in the chain.
  • The cluster is the last cluster in an allocation chain associated with a specific file or directory.
  • The cluster is bad.

The first cluster entry in the allocation table is typically used for the volume’s FAT ID, and the second entry indicates that the cluster is reserved. In a FAT32 volume, the third entry usually corresponds to the first cluster used for the root directory. The rest of the cluster entries in the allocation table are devoted to the directory and file allocation chains.

Each chain begins with the cluster identified in the root directory listing for that directory or file. A chain might be made up of only one cluster, in which case it’s marked as the last cluster in the chain.

When reading a file from a FAT volume, the operating system reassembles the file from the clusters — referencing the allocation table for the file’s chain linkage — and then renders the file in its entirety in memory.

FAT file systems limit the file names to 11 characters, eight for the file name and three for the file extension. This is known as 8.3 file names. Support for longer file and folder names, up to 255 characters, was added with Virtual FAT extensions. Most systems can use the long file name, while older or simple systems can fall back to the short names.

File allocation table advantages and disadvantages

FAT has its advantages and disadvantages. Here are some of its advantages:

  • Simple. Easy to implement for embedded and standalone systems.
  • Wide compatibility. Almost any system can natively read and write to a FAT volume, including macOS, Linux, embedded systems and even some IoT devices.

The following are some disadvantages of FAT:

  • Limited volume and file sizes. In FAT32, files are limited to 4 GB and volumes to 2 TB.
  • Disk fragmentation. As files are written and deleted, they can become spread across the disk, leading to decreased performance.
  • No resiliency. Other file systems, such as NTFS, implement change journaling and other fault tolerant features. This can help to prevent a disk from becoming corrupted and losing data.

Learn the differences between FAT16, FAT32, NTFS and ReFS Windows file systems, each with its own unique capabilities and use cases. Compare block vs. file vs. object storage differences and uses. See how to use diskpart to create, delete and modify disk partitions. Find out how AWS implements its file services — Amazon FSx and Amazon EFS — based on Windows Server Message Block and NFS.



Source link

Leave a comment

All fields marked with an asterisk (*) are required