In This Article
What is File Allocation Table (FAT)?
File Allocation Table, or FAT refers to the process of keeping track by the Microsoft operating system of the contents on a hard drive. In simple words, it is a table that defines the status of cluster allocation and content relations in a file system.
Technically, the structure of a FAT volume in this file system has a boot sector in the beginning, two sectors to store the primary and duplicate FAT before a root directory sector, followed by a sector for other files and directories.
- FAT is a specific file system designed for hard drives and used 12 and 16 bits initially for every cluster entry in the table. There is an entry point and an allocation chain for the allocation unit in every file on a FAT volume.
- File Allocation Table is a file system with an index table. It is allocated statically while formatting and stored on the drive itself which helps to identify the chains of data storage areas in a file.
- The FAT system typically uses a complete disk block for data and ensures that a bad disk block does not cause the loss of all successive blocks, though every disk block needs a FAT entry.
- This system allows random access, though it is not very quick and for every file operation only FAT requires to be navigated, irrespective of the fact that the size of FAT may be very big according to the number of entries.
- When the block size is increased, the number of FAT entries may be lowered, but at the same time it may lead to internal fragmentation of the disks on which the data is stored.
Understanding File Allocation Table
The File Allocation Table was originally designed for use on floppy disks, but later on it became the default file system for the Windows 9x operating system and MS-DOS.
Gradually, it was further modified so that it could be used on the hard disks used in computers and other devices.
Over time, with the increase in the capacity of Hard Disk Drives (HDDs) more variants of FAT were further developed.
Typically, files stored on a hard drive are accessed by a process called seeking, which refers to actual physical searching.
This involves moving the read and write heads on the disk, which takes some time.
The FAT file system is especially designed to reduce this time by ensuring that the heads do not need to move much. This, in turn, reduces the wear and tear as well.
For a file in the FAT volume, there is an entry point to store its first segment followed by an allocation chain.
The allocation chain is a set of links that indicates the location of the following segments of the file. It is terminated by an EOF or End of File marker.
The FAT structure basically maps the positions of the clusters on a disk where files and folders are stored. This basically makes up the file and provides the sequence in which the file is stored.
This is very important because the files or data on a hard disk are often not kept in a contiguous setting due to the continuous creation and deletion of files that cause disk fragmentation.
When a file is read from a FAT volume, that particular file from the cluster is reassembled by the operating system.
This is done with reference to the allocation table related to the chain linkage of the file. The operating system then renders the file in memory in its entirety.
There are different FAT volumes that are categorized according to the FAT type, the number of clusters and their sizes. It all depends on the sizes of the drives, as explained below:
- For a drive measuring between 0 MB and 15 MB, the FAT type is usually 12-bit with 8 clusters of 4 K.
- For 16 MB to 127 MB, it is 16-bit and 4 clusters of 2 K.
- For 128 MB to 255 MB, it is 16-bit and 8 clusters of 4 K.
- For 256 MB to 511 MB, it is 16-bit and 16 clusters of 8 K.
- For 512 MB to 1023 MB, it is 16-bit and 32 clusters of 16 K.
- For 1024 MB to 2047 MB, it is 16-bit and 64 clusters of 32 K.
- For 2048 MB to 4095 MB, it is 16-bit and 128 clusters of 64 K.
Ideally, there are four distinct sections in a FAT file system. Each of these sections forms a part of the structure of the FAT partition. These sections are:
This section is alternatively known as the reserved sector and it is typically found on the initial part of the disk. This specific section contains the following:
- The boot loader code needed by the operating system to start a computer system.
- The Master Boot Record (MRB), also known as the partition table, describes exactly how the drive is organized.
- The Basic Input Output System (BIOS) Parameter Block, also referred to as the BPB, describing the physical framework of the data storage volume.
This particular section consists of two copies of FAT. This helps in checking the redundancy and describes how exactly the clusters are assigned.
Since this region contains a duplicate of the primary allocation table, it is also referred to as the Allocation Table Region. This duplicate FAT acts as a backup when the primary allocation table cannot be accessed.
In this specific section of FAT, all existing files along with the directory data are stored. It typically takes up the major part of the partition.
Root Directory Region
This final section of the FAT file system refers to the directory table. The information about the files and directories is stored in this specific section. It is usually used with FAT16 and FAT12 and a fixed maximum size is created here.
The root directory in FAT32 is typically stored in the data region. It can be expanded as and when required.
In the FAT file system, each entry made into the table matches with a cluster. These entries are typically made in one of the following four states of the cluster:
- When the cluster is unused.
- When the cluster is within an allocation chain linked with a specific directory or file, and the table entry references the following cluster in that specific chain.
- When the cluster is the final one in the allocation chain related to a particular file or directory.
- When the cluster is bad.
Each of these entries in FAT has different uses and implications such as:
- The first cluster entry is usually used for the FAT ID of the volume.
- The second entry is used to specify that the cluster is reserved.
- The third entry in the FAT32 volume typically resembles the initial cluster associated with the root directory.
- The remaining cluster entries in FAT are dedicated to the file allocation chain and the directory.
Every chain here starts with the identified cluster in the root directory listing for a specific file or directory. This chain can consist of only one single cluster. In that case, it is considered to be the last cluster of the chain.
File Allocation Table Types
Introduced in 1977, there are different types of FAT available such as FAT8, FAT12, FAT16, and FAT32. All these different types are suited for different operating systems.
This is the oldest FAT and was used typically on the 8-inch floppy disks with the 8086 processor.
This type of FAT typically uses a 12-bit binary system. Though it is a derivation of FAT8, a FAT12-formatted hard drive was able to use approximately 16,736,256-bytes.
However, the earlier FAT12 used cluster addresses of 12-bit values and supported up to 4078 clusters. With UNIX, it allowed up to 4084 clusters.
This type of FAT is used with Windows 95 and Windows 3.x and uses a 16-bit binary system. It was introduced by IBM in 1983 with the simultaneous release of their personal computer AT and MS-DOS 3.0 software from Microsoft.
FAT16 is supposed to be more efficient because it uses 16-bit cluster addresses which allows up to 65,517 clusters in each volume. With 32 MB of space, it also supports 512-byte clusters and a bigger file system with four different sectors totaling up to 2,048 bytes.
This is an enhanced version of FAT introduced by Microsoft in 1997. It uses a 28-bit binary system and was used in Windows 98 and Windows 95 OSR2 for the first time. It has the ability to save disk space by using a 4K cluster.
This particular file system has enhanced size limits. It can also handle the format with its DOS real-mode code support.
The file system has a 32-bit cluster address. Out of this, 28 bits are used to store the cluster. The number can be as high as about 268 million clusters.
There are also a few derivatives of FAT as well, such as:
- Turbo FAT, which is implemented for the NetWare operating system.
- FATX, which is especially for the memory cards and hard drives used in Microsoft’s Xbox video game console.
- exFAT, which is based on the FAT architecture but is not as compatible.
File Allocation Table Uses
The File Allocation Table is mainly used by the operating system for managing the files stored on the hard drives as well as in other computer systems. It plays a significant role in helping access different files and directories on a FAT volume.
Basically, it is not only used to store data and information in a much more organized way for quicker access but also to boost the life of a hard drive.
Here are some specific use cases of the File Allocation Table file system.
Historically, the FAT file system was on hard disks running on DOS and Windows 9x operating systems. It was also the standard for home users until 2001, when Windows XP was released.
It was also used extensively for floppy disks, especially FAT12, with short 8.3 filename support only. FAT16 and FAT32 were used on larger media.
Since its supports hard drives as well as the subdirectories, this specific file system is used widely for Windows computer systems.
In the later periods, this file system is used in the (Extensible Firmware Interface) EFI system partition while booting the EFI-compliant computer systems.
The file system is also used in drives in a shared environment of operating systems such as Windows, Linux, and DOS.
Apart from these, there are also several other removable drives and media as well as different portable devices where the FAT file system is used. These are:
- Universal Serial Bus (USB) flash drives
- Flash memory cards
- Personal Digital Assistants (PDAs)
- Media Players
- Mobile phones
Even digital cameras use this file system through the Design Rule for Camera (DCF) file system that they usually adopt.
This is because this file system describes a logical file system with 8.3 filenames.
This typically uses either FAT12, FAT16, FAT32 or exFAT mandatorily for its physical layer to ensure compatibility.
However, now the Windows systems use a more efficient New Technology File System (NTFS) mainly, along with the Resilient File System (ReFS) to a lesser degree, in place of the FAT file system. These offer more scalability, availability, and resilience.
Still, the current versions of the Windows operating system support File Allocation Table, just like other operating systems such as Linux, macOS, and Unix do. So, it is still used in:
- Smaller portable devices such as digital cameras
- Other storage media such as USB flash drives
- Flash and other solid-state memory modules and cards
- Embedded devices
It is mainly due to its greater compatibility and ease of operation.
- It uses the entire block of the disk for storing data.
- The successive blocks are not lost due to a bad block.
- It offers random access to data, though it may not be exceptionally fast.
- The FAT needs to traverse only during every operation.
- It supports a large partition size, which may be up to 8 TB.
- It is used extensively by a large number of manufacturers of computer appliances being the oldest of the three file systems existing for Windows operating system.
- It is compatible with other file systems and therefore offers easy conversion routes without any data loss.
- It is quite easy to use and implement.
- It works on most of the operating systems that are available including Linux and macOS, apart from Windows.
- Every block on the disk needs a FAT entry.
- The FAT file size may be quite big according to the number of FAT entries.
- Increasing the block size to reduce the number of entries may lead to internal fragmentation.
- The file size supported is typically up to 4 GB.
- Security for the stored data is limited which may cause frequent and illicit tampering with data.
- Lack of fault tolerance.
- It does not support encryption of each individual file or folder.
- There is no support offered by it for data recovery in the event of data loss.
- It is not supported any longer by a lot of technological manufacturers due to the precedence of the newer, and often better, file systems.
FAT Vs NTFS
- FAT is an older technology in comparison to the New Technology File System (NTFS) being released in 1977 as opposed to the 1993-release of the latter.
- In terms of security, FAT file systems do not offer security to the files and folders stored on the disk as NTFS, which provides complete security to those in the system.
- In the FAT file system, the files and folders cannot be restored or recovered in the event of any failure. On the other hand, NTFS allows restoring the files and folders easily in such situations.
- The FAT file system does not support file compression, but in comparison, NTFS supports flexible compression for each file.
- The maximum file size supported by the FAT file system is up to 4 GB, as opposed to NTFS, which supports file sizes ranging anywhere between 4 GB and 64 GB and more.
- FAT file systems are compatible with other operating systems and different platforms and therefore allows accessing the files through a computer. On the other hand, NTFS allows accessing files only on the limited familiar platforms.
- When it comes to data sharing, FAT file systems allow sharing it between different operating systems, while NTFS do not.
- The FAT file system is not as reliable and stable as NTFS.
- The speed of reading and writing data from the hard disks on the FAT file system is not as high as they are on NTFS.
- The FAT file system does not support dual booting, but NTFS does.
- The data in FAT file systems cannot be accessed or shared over the network, but in comparison, NTFS allows it.
- The FAT file systems do not support file encryption as NTFS does.
- The structure of the FAT file system is quite simple. On the other hand, the architecture of the NTFS is more complicated.
- The FAT devices can store large files, but they are fewer in number as compared to NTFS due to its design and low volume.
- NTFS is an advanced version of the FAT file system and therefore performs much better in comparison.
- The maximum number of characters supported by the FAT file system is up to 83 in a file. On the other hand, the NT file system can support as many as up to 255 characters.
Where is the File Allocation Table Located?
The File Allocation Table is typically located in the first sector of the disk. This specific region is called disk sector 0.
Apart from that, it may also be found in other devices such as flash memory drives, digital cameras, and other removable devices.
FAT is a significant file system for Windows and other operating systems.
Offering a diverse range of advantages and disadvantages, this file system allows for better organization of the files and easier access.
However, it is not as popular or as good as the NTFS, and you know why, thanks to this article.