Sponsored Links
-->

Saturday, June 16, 2018

File Allocation Tables Article about File Allocation 7268589 ...
src: slideplayer.com

File Allocation Table (FAT) is a computer file system architecture and a family of industry-standard file systems utilizing it. The FAT file system is a continuing standard which borrows source code from the original, legacy file system and proves to be simple and robust. It offers useful performance even in lightweight implementations, but cannot deliver the same performance, reliability and scalability as some modern file systems. It is, however, supported for compatibility reasons by nearly all currently developed operating systems for personal computers and many mobile devices and embedded systems, and thus is a well-suited format for data exchange between computers and devices of almost any type and age from 1981 up to the present.

Originally designed in 1977 for use on floppy disks, FAT was soon adapted and used almost universally on hard disks throughout the DOS and Windows 9x eras for two decades. As disk drives evolved, the capabilities of the file system have been extended accordingly, resulting in three major file system variants: FAT12, FAT16 and FAT32. The FAT standard has also been expanded in other ways while generally preserving backward compatibility with existing software.

With the introduction of more powerful computers and operating systems, as well as the development of more complex file systems for them, FAT is no longer the default file system for usage on Microsoft Windows computers.

FAT file systems are still commonly found on floppy disks, flash and other solid-state memory cards and modules (including USB flash drives), as well as many portable and embedded devices. FAT is the standard file system for digital cameras per the DCF specification.


Video File Allocation Table



Overview

Concepts

The name of the file system originates from the file system's prominent usage of an index table, the File Allocation Table (FAT), statically allocated at the time of formatting. The table contains entries for each cluster, a contiguous area of disk storage. Each entry contains either the number of the next cluster in the file, or else a marker indicating end of file, unused disk space, or special reserved areas of the disk. The root directory of the disk contains the number of the first cluster of each file in that directory; the operating system can then traverse the FAT, looking up the cluster number of each successive part of the disk file as a cluster chain until the end of the file is reached. In much the same way, sub-directories are implemented as special files containing the directory entries of their respective files.

Originally designed as an 8-bit file system, the maximum number of clusters has been significantly increased as disk drives have evolved, and so the number of bits used to identify each cluster has grown. The successive major variants of the FAT format are named after the number of table element bits: 12 (FAT12), 16 (FAT16), and 32 (FAT32). Except for the original 8-bit FAT precursor, each of these variants is still in use. The FAT standard has also been expanded in other ways while generally preserving backward compatibility with existing software.

Uses

The FAT file system has a long history (over three decades) of usage on desktops and portable computers, and it is frequently used in embedded solutions.

FAT offers reasonably good performance and robustness, even in very light-weight implementations. It is therefore widely adopted and supported by virtually all existing operating systems for personal computers as well as some home computers and a multitude of embedded systems. This also makes it a useful format for solid-state memory cards and a convenient way to share data between operating systems.

FAT file systems are the default file system for removable media (with the exception of CDs and DVDs) and as such are commonly found on floppy disks, super-floppies, memory and flash memory cards or USB flash drives and are supported by most portable devices such as PDAs, digital cameras, camcorders, media players, or mobile phones. While FAT12 is omnipresent on floppy disks, FAT16 and FAT32 are typically found on the larger media.

FAT was also commonly used on hard disks throughout the DOS and Windows 9x eras, but its use on hard drives has declined since the introduction of Windows XP, which primarily uses the newer NTFS. FAT is still used in hard drives expected to be used by multiple operating systems, such as in shared Windows, GNU/Linux and DOS environments.

Due to the widespread use of FAT-formatted media, many operating systems provide support for FAT through official or third-party file system handlers. For example, OS/2, GNU/Linux, FreeBSD and BeOS provide built-in support for FAT, even though they also support more sophisticated file systems such as ext4 or btrfs. Mac OS 9 and macOS support FAT file systems on volumes other than the boot disk. AmigaOS supports FAT through the CrossDOS package.

For many purposes, the NTFS file system is superior to FAT in terms of features and reliability; its main drawbacks are its complexity and the size overhead for small volumes as well as the very limited support by anything other than the NT-based versions of Windows, since the exact specification is a trade secret of Microsoft. The availability of NTFS-3G since mid-2006 has led to much improved NTFS support in Unix-like operating systems, considerably alleviating this concern. It is still not possible to use NTFS in DOS-like operating systems without third-party drivers, which in turn makes it difficult to use a DOS floppy for recovery purposes. Microsoft provided a Recovery Console to work around this issue, but for security reasons it severely limited what could be done through the Recovery Console by default. The movement of recovery utilities to boot CDs based on BartPE, Linux (with NTFS-3G), or WinPE is eroding this drawback, but the complexity of NTFS prevents its implementation in light-weight operating systems or most embedded systems.

The DCF file system adopted by almost all digital cameras since 1998 defines a logical file system with 8.3 filenames and makes the use of either FAT12, FAT16, FAT32 or exFAT mandatory for its physical layer in order to maximize platform interoperability.

FAT is also used internally for the EFI system partition (partition type 0xEF) in the boot stage of EFI-compliant computers.

Hidden FAT filesystems are also used in the UEFI boot partition on modern PC's where the UEFI specification requires compliant firmware to be capable of reading FAT12, FAT16 and FAT32 compliant partitions.

For floppy disks, FAT has been standardized as ECMA-107 and ISO/IEC 9293:1994 (superseding ISO 9293:1987). These standards cover FAT12 and FAT16 with only short 8.3 filename support; long filenames with VFAT are partially patented.

Nomenclature

Technically, the term "FAT file system" refers to all three major variants of the file system, FAT12, FAT16 and FAT32, and most parties clearly distinguish between them where necessary. In contrast to this, Microsoft typically no longer distinguishes between all three of them since the introduction of FAT32, and refers to both FAT12 and FAT16 as "FAT", whereas "FAT32" gets treated specially in dialog boxes and documentation. This can sometimes lead to confusion if the actual type of the file system used is not mentioned or cannot be explicitly specified (e.g., "Do you want to format as FAT or FAT32?" instead of "Do you want to format as FAT12, FAT16 or FAT32?").

Another common cause of confusion exists within the group of FAT16 file systems, since the term "FAT16" refers to both, either the whole group of FAT file systems with 16-bit wide cluster entries, or specifically only the original implementation of it with 16-bit sector entries, when it becomes necessary to differentiate between the original and the later implementation. While technically the newer variant with 32-bit sector entries is called "FAT16B", it is commonly referred to under the name "FAT16" as well, in particular since the original variant is rarely seen today and typically only used on small media when backward compatibility with DOS before 3.31 is required.

Further, the term "VFAT" has led to various misconceptions as well, as it is sometimes erroneously used as if it would describe another variant of FAT file system to be distinguished from the FAT12, FAT16 and FAT32 file systems, while in reality it does not specify another file system, but an optional extension, which can work on top of any FAT file system, FAT12, FAT16 or FAT32. Volumes utilizing VFAT long-filenames can be read also by operating systems not supporting the VFAT extension, as long any operating systems that support the underlying file system (FAT12, FAT16, or FAT32).

Yet another cause for misconceptions stems from some apparent redundancy and possible ambiguity in the definition of FAT volumes. The general type of file system (FAT12, FAT16 or FAT32) is determined by the width of the cluster entries in the FAT. Specific threshold values for the amount of clusters (as stored in the BPB) have been defined to determine which FAT type is used. Even though other properties such as the size of the volume, the count of sectors, the BPB format, the file system name in an EBPB, or -in case of partitioned media- the used partition ID may often seem to be well-suited distinguishing criteria as well, they cannot reliably be used to derive the file system type from in all scenarios. Whilst uncommon, it is technically possible to define a FAT12 or FAT16 volume using a "FAT32 EBPB" (which is sort of a misnomer for the EBPB variant introduced with DOS 7.1), which is normally used for FAT32 volumes, only. Also, while partition IDs sometimes indicate special properties such as hidden, secure, CHS or LBA access to an operating system, and as such are often used in conjunction with particular file system variants only, they are typically not used to specify a type of file system by themselves, but rather to keep (older or foreign) operating systems not aware of a partition ID from accessing partitions they cannot handle or should not work with. It is therefore necessary to distinguish generic FAT file system types such as FAT12, FAT16 or FAT32 from FAT partition types such as FAT12, FAT16, FAT16B, FAT16X, FAT32, FAT32X etc.


Maps File Allocation Table



Types

Original 8-bit FAT

The original FAT file system (or FAT structure, as it was called initially) was designed and coded by Marc McDonald, based on a series of discussions between McDonald and Bill Gates. It was introduced with 8-bit table elements (and valid data cluster numbers up to 0xBF) in a precursor to Microsoft's Standalone Disk BASIC-80 for an 8080-based successor of the NCR 7200 model VI data-entry terminal, equipped with 8-inch (200 mm) floppy disks, in 1977/1978. In 1978, Standalone Disk BASIC-80 was ported to the 8086 using an emulator on a DEC PDP-10, since no real 8086 systems were available at this time. The FAT file system was also utilized in Microsoft's MDOS/MIDAS, an operating system for 8080/Z80 platforms written by McDonald since 1979. The Standalone Disk BASIC version supported three FATs, whereas this was a parameter for MIDAS. Reportedly, MIDAS was also prepared to support 10-bit, 12-bit and 16-bit FAT variants. While the size of directory entries was 16 bytes in Standalone Disk BASIC, MIDAS instead occupied 32 bytes per entry.

Tim Paterson of Seattle Computer Products (SCP) was first introduced to Microsoft's FAT structure when he helped Bob O'Rear adapting the Standalone Disk BASIC-86 emulator port onto SCP's S-100 bus 8086 CPU board prototype during a guest week at Microsoft in May 1979. The final product was shown at Lifeboat Associates' booth stand at the National Computer Conference in New York on June 4-7, 1979, where Paterson learned about the more sophisticated FAT implementation in MDOS/MIDAS and McDonald talked to him about the design of the file system.

FAT12

Between April and August 1980, while borrowing the FAT concept for SCP's own 8086 operating system QDOS 0.10, Tim Paterson extended the table elements to 12 bits, reduced the number of FATs to two, redefined the semantics of some of the reserved cluster values, and modified the disk layout, so that the root directory was now located between the FAT and the data area for his implementation of FAT12. Paterson also increased the nine-character (6.3) filename length limit to eleven characters in order to support CP/M-style 8.3 filenames and File Control Blocks. The format used in Microsoft Standalone Disk BASIC's 8-bit file system precursor was not supported by QDOS. By August 1980, QDOS had been already renamed 86-DOS. Starting with 86-DOS 0.42, the size and layout of directory entries was changed from 16 bytes to 32 bytes in order to add a file date stamp and increase the theoretical file size limit beyond the previous limit of 16 MB. 86-DOS 1.00 became available in early 1981. Later in 1981, 86-DOS evolved into Microsoft's MS-DOS and IBM PC DOS. The capability to read previously formatted volumes with 16-byte directory entries was dropped with MS-DOS 1.20.

Originally designed as a file system for floppy disks, FAT12 used 12-bit entries for the cluster addresses in the FAT, which not only limited the maximum generally possible count of data clusters to 4078 (for data clusters 0x002 to 0xFEF) or in some controlled scenarios even up to 4084 (for data clusters 0x002 to 0xFF5), but made FAT manipulation tricky with the PC's 8-bit and 16-bit registers. (While MS-DOS and PC DOS support up to 4084 data clusters on FAT12 volumes in general, cluster value 0xFF0 is treated as additional end-of-chain marker on any FAT12 volume since MS-DOS/PC DOS 3.3, which also introduced the 0xF0 media descriptor value, therefore restricting the maximum practical number of data clusters to 4078 for compatibility purposes with these operating systems.)

The disk's size was stored and calculated as a 16-bit count of sectors, which limited the size to 32 MiB for a logical sector size of 512 bytes. FAT12 was used by several manufacturers with different physical formats, but a typical floppy disk at the time was 5.25-inch (130 mm), single-sided, 40 tracks, with 8 sectors per track, resulting in a capacity of 160 KiB for both the system areas and files. The FAT12 limitations exceeded this capacity by a factor of ten or more. (NB. The 32 MiB limit was later circumvented using logical sectored FATs with logical sector sizes larger than 512 bytes in some OEM versions of MS-DOS 3.x, but this fell into disuse when FAT16B became available with DOS 3.31, which supported 32-bit sector numbers and thereby further lifted the limits.)

By convention, all the control structures were organized to fit inside the first track, thus avoiding head movement during read and write operations, although this varied depending on the manufacturer and physical format of the disk. A limitation which was not addressed until much later (with FAT32) was that any bad sector in the control structures area, track 0, could prevent the disk from being usable. The DOS formatting tool rejected such disks completely. Bad sectors were allowed only in the file data area and (since DOS 2.0) were marked with the reserved value 0xFF7 in the FAT. They made the entire containing cluster unusable.

While 86-DOS supported three disk formats (250.25 KiB, 616 KiB and 1232 KiB with FAT IDs 0xFF and 0xFE) on 8-inch (200 mm) floppy drives, IBM PC DOS 1.0, released with the original IBM Personal Computer in 1981, supported only an 8-sector floppy format with a formatted capacity of 160 KiB (FAT ID 0xFE) for single-sided 5.25-inch floppy drives, and PC DOS 1.1 added support for a double-sided format with 320 KiB (FAT ID 0xFF). PC DOS 2.0 introduced support for 9-sector floppy formats with 180 KiB (FAT ID 0xFC) and 360 KiB (FAT ID 0xFD).

86-DOS 1.00 and PC DOS 1.0 directory entries included only one date, the last modified date. PC DOS 1.1 added the last modified time. PC DOS 1.x file attributes included a hidden bit and system bit, with the remaining six bits undefined. At this time, DOS did not support a hierarchical file system, which was still acceptable, given that the number of files on a disk was typically not more than a few dozen.

The PC XT was the first PC with a hard drive from IBM, and PC DOS 2.0 supported that hard drive with FAT12 (FAT ID 0xF8). The fixed assumption of 8 sectors per clusters on hard disks practically limited the maximum partition size to 16 MiB for 512 byte sectors and 4 KiB clusters.

The BIOS Parameter Block (BPB) was introduced with PC DOS 2.0 as well, and this version also added read-only, archive, volume label, and directory attribute bits for hierarchical sub-directories.

MS-DOS 3.0 introduced support for high-density 1.2 MiB 5.25-inch diskettes (media descriptor 0xF9), which notably had 15 sectors per track, hence more space for the FATs.

FAT12 remains in use on all common floppy disks, including 1.44 MiB and later 2.88 MiB disks (media descriptor byte 0xF0).

Initial FAT16

On August 14, 1984, IBM released the PC AT, which featured a 20 MiB hard disk and PC DOS 3.0. Microsoft introduced MS-DOS 3.0 in parallel. Cluster addresses were increased to 16-bit, allowing for up to 65,524 clusters per volume, and consequently much greater file system sizes, at least in theory. However, the maximum possible number of sectors and the maximum (partition, rather than disk) size of 32 MiB did not change. Therefore, although cluster addresses were 16 bits, this format was not what today is commonly understood as FAT16. A partition type 0x04 indicates this form of FAT16 with less than 65536 sectors (less than 32 MiB for sector size 512).

With the initial implementation of FAT16 not actually providing for larger partition sizes than FAT12, the early benefit of FAT16 was to enable the use of smaller clusters, making disk usage more efficient, particularly for large numbers of files only a few hundred bytes in size.

As MS-DOS 3.0 and higher formatted all 16 MiB-32 MiB partitions in the FAT16 format, a 20 MiB hard disk formatted under MS-DOS 3.0 was not accessible by the older MS-DOS 2.0 although MS-DOS 2.0 was able to access 16 MiB-32 MiB FAT12 partitions. MS-DOS 3.0 to MS-DOS 3.30 could still access FAT12 partitions under 15 MiB but required all 16 MiB-32 MiB partitions to be FAT16, and so failed to access MS-DOS 2.0 partitions in this size range. MS-DOS 3.31 and higher could access 16 MiB-32 MiB FAT12 partitions again.

Logical sectored FAT

When hard disks grew larger and the FAT12 and FAT16 file system implementation in MS-DOS / PC DOS did not provide means to take advantage of the extra storage, several manufacturers developed their own FAT variants to address the problem in their MS-DOS OEM issues.

Some vendors (AST and NEC) supported eight, instead of the standard four, primary partition entries in their custom extended Master Boot Record (MBR), and they adapted MS-DOS to use more than a single primary partition.

Other vendors worked around the volume size limits imposed by the 16-bit sector entries and arithmetics by increasing the size of the sectors the file system dealt with, thereby blowing up dimensions.

These so-called logical sectors were larger (up to 8192 bytes) than the physical sector size (still typically 512 bytes) as expected by the ROM-BIOS INT 13H or the disk drive hardware. The DOS-BIOS or System BIOS would then combine multiple physical sectors into logical sectors for the file system to work with. These changes were transparent to the file system implementation in the DOS kernel, since on the file system's abstraction level volumes are seen as a linear series of logically addressable sectors, also known as absolute sectors (addressed by their Logical Sector Number (LSN), starting with LSN 0) independent of the physical location of the volume on the physical medium and its geometry. The underlying DOS-BIOS translated these logical sectors into physical sectors according to partitioning information and the drive's physical geometry.

The drawback of this approach was a less memory-efficient sector buffering and deblocking in the DOS-BIOS, thereby causing an increased memory footprint for the DOS data structures. Since older DOS versions were not flexible enough to work with these logical geometries, the OEMs had to introduce new partition IDs for their FAT variants in order to hide them from off-the-shelf issues of MS-DOS and PC DOS. Known partition IDs for logical sectored FATs include: 0x08 (Commodore MS-DOS 3.x), 0x11 (Leading Edge MS-DOS 3.x), 0x14 (AST MS-DOS 3.x), 0x24 (NEC MS-DOS 3.30), 0x56 (AT&T MS-DOS 3.x), 0xE5 (Tandy MS-DOS), 0xF2 (Sperry IT MS-DOS 3.x, Unisys MS-DOS 3.3 - also used by Digital Research DOS Plus 2.1). OEM versions like Toshiba MS-DOS, Wyse MS-DOS 3.2 and 3.3, as well as Zenith MS-DOS are also known to have utilized logical sectoring.

While non-standard and sub-optimal, these FAT variants are perfectly valid according to the specifications of the file system itself. Therefore, even if default issues of MS-DOS and PC DOS were not able to cope with them, most of these vendor-specific FAT12 and FAT16 variants can be mounted by more flexible file system implementations in operating systems such as DR-DOS, simply by changing the partition ID to one of the recognized types. Also, if they no longer need to be recognized by their original operating systems, existing partitions can be "converted" into FAT12 and FAT16 volumes more compliant with versions of MS-DOS/PC DOS 4.0-6.3, which do not support sector sizes different from 512 bytes, by switching to a BPB with 32-bit entry for the number of sectors, as introduced since DOS 3.31 (see FAT16B below), keeping the cluster size and reducing the logical sector size in the BPB down to 512 bytes, while at the same time increasing the counts of logical sectors per cluster, reserved logical sectors, total logical sectors, and logical sectors per FAT by the same factor.

A parallel development in MS-DOS / PC DOS which allowed an increase in the maximum possible FAT size was the introduction of multiple FAT partitions on a hard disk. To allow the use of more FAT partitions in a compatible way, a new partition type was introduced in PC DOS 3.2 (1986), the extended partition (EBR), which is a container for an additional partition called logical drive. Since PC DOS 3.3 (April 1987), there is another, optional extended partition containing the next logical drive, and so on. The MBR of a hard disk can either define up to four primary partitions, or an extended partition in addition to up to three primary partitions.

Final FAT16

In November 1987, Compaq Personal Computer DOS 3.31 (a modified OEM version of MS-DOS 3.3 released by Compaq with their machines) introduced what today is simply known as the FAT16 format, with the expansion of the 16-bit disk sector count to 32 bits in the BPB. Although the on-disk changes were minor, the entire DOS disk driver had to be converted to use 32-bit sector numbers, a task complicated by the fact that it was written in 16-bit assembly language. The result was initially called the DOS 3.31 Large File System. Microsoft's DSKPROBE tool refers to type 0x06 as BigFAT, whereas some older versions of FDISK described it as BIGDOS. Technically, it is known as FAT16B.

Since older versions of DOS were not designed to cope with more than 65535 sectors, it was necessary to introduce a new partition type for this format in order to hide it from pre-3.31 issues of DOS. The original form of FAT16 (with less than 65536 sectors) had a partition type 0x04. To deal with disks larger than this, type 0x06 was introduced to indicate 65536 or more sectors. In addition to this, the disk driver was expanded to cope with more than 65535 sectors as well. The only other difference between the original FAT16 and the newer FAT16B format is the usage of a newer BPB format with 32-bit sector entry. Therefore, newer operating systems supporting the FAT16B format can cope also with the original FAT16 format without any necessary changes.

If partitions to be used by pre-DOS 3.31 issues of DOS need to be created by modern tools, the only criteria theoretically necessary to meet are a sector count of less than 65536, and the usage of the old partition ID (0x04). In practice however, type 0x01 and 0x04 primary partitions should not be physically located outside the first 32 MiB of the disk, due to other restrictions in MS-DOS 2.x, which could not cope with them otherwise.

In 1988, the FAT16B improvement became more generally available through DR DOS 3.31, PC DOS 4.0, OS/2 1.1, and MS-DOS 4.0. The limit on partition size was dictated by the 8-bit signed count of sectors per cluster, which originally had a maximum power-of-two value of 64. With the standard hard disk sector size of 512 bytes, this gives a maximum of 32 KiB cluster size, thereby fixing the "definitive" limit for the FAT16 partition size at 2 GiB for sector size 512. On magneto-optical media, which can have 1 or 2 KiB sectors instead of 0.5 KiB, this size limit is proportionally larger.

Much later, Windows NT increased the maximum cluster size to 64 KiB, by considering the sectors-per-cluster count as unsigned. However, the resulting format was not compatible with any other FAT implementation of the time, and it generated greater internal fragmentation. Windows 98, SE and ME also supported reading and writing this variant, but its disk utilities did not work with it and some FCB services are not available for such volumes. This contributes to a confusing compatibility situation.

Prior to 1995, versions of DOS accessed the disk via CHS addressing only. When MS-DOS 7.0 / Windows 95 introduced LBA disk access, partitions could start being physically located outside the first ca. 8 GiB of this disk and thereby out of the reach of the traditional CHS addressing scheme. Partitions partially or fully located beyond the CHS barrier therefore had to be hidden from non-LBA-enabled operating systems by using the new partition type 0x0E in the partition table instead. FAT16 partitions using this partition type are also named FAT16X. The only difference, compared to previous FAT16 partitions, is the fact that some CHS-related geometry entries in the BPB record, namely the number of sectors per track and the number of heads, may contain no or misleading values and should not be used.

The number of root directory entries available for FAT12 and FAT16 is determined when the volume is formatted, and is stored in a 16-bit field. For a given number RDE and sector size SS, the number RDS of root directory sectors is RDS=ceil((RDE×32)/SS), and RDE is normally chosen to fill these sectors, i.e., RDE*32=RDS*SS. FAT12 and FAT16 media typically use 512 root directory entries on non-floppy media. Some third-party tools, like mkdosfs, allow the user to set this parameter.

FAT32

In order to overcome the volume size limit of FAT16, while at the same time allowing DOS real mode code to handle the format, Microsoft designed a new version of the file system, FAT32, which supported an increased number of possible clusters, but could reuse most of the existing code, so that the conventional memory footprint was increased by less than 5 KiB under DOS. Cluster values are represented by 32-bit numbers, of which 28 bits are used to hold the cluster number. The boot sector uses a 32-bit field for the sector count, limiting the FAT32 volume size to 2 TiB for a sector size of 512 bytes and 16 TiB for a sector size of 4,096 bytes. FAT32 was introduced with MS-DOS 7.1 / Windows 95 OSR2 in 1996, although reformatting was needed to use it, and DriveSpace 3 (the version that came with Windows 95 OSR2 and Windows 98) never supported it. Windows 98 introduced a utility to convert existing hard disks from FAT16 to FAT32 without loss of data. In the Windows NT line, native support for FAT32 arrived in Windows 2000. A free FAT32 driver for Windows NT 4.0 was available from Winternals, a company later acquired by Microsoft. The acquisition of the driver from official sources is no longer possible. Since 1998, Caldera's dynamically loadable DRFAT32 driver could be used to enable FAT32 support in DR-DOS. The first version of DR-DOS to natively support FAT32 and LBA access was OEM DR-DOS 7.04 in 1999. That same year IMS introduced native FAT32 support with REAL/32 7.90, and IBM 4690 OS added FAT32 support with version 2. Ahead Software provided another dynamically loadable FAT32.EXE driver for DR-DOS 7.03 with Nero Burning ROM in 2004. IBM PC DOS introduced native FAT32 support with OEM PC DOS 7.10 in 2003.

The maximum possible size for a file on a FAT32 volume is 4 GiB minus 1 byte or 4,294,967,295 (232 - 1) bytes. This limit is a consequence of the file length entry in the directory table and would also affect huge FAT16 partitions with a sufficient sector size. Large video files, DVD images and databases often exceed this limit.

As with previous file systems, the design of the FAT32 file system does not include direct built-in support for long filenames, but FAT32 volumes can optionally hold VFAT long filenames in addition to short filenames in exactly the same way as VFAT long filenames have been optionally implemented for FAT12 and FAT16 volumes.

Two partition types have been reserved for FAT32 partitions, 0x0B and 0x0C. The latter type is also named FAT32X in order to indicate usage of LBA disk access instead of CHS. On such partitions, CHS-related geometry entries, namely the CHS sector addresses in the MBR as well as the number of sectors per track and the number of heads in the EBPB record, may contain no or misleading values and should not be used.


File Allocation Tables Article about File Allocation 7268589 ...
src: slideplayer.com


Extensions

Extended Attributes

OS/2 heavily depends on extended attributes (EAs) and stores them in a hidden file called "EASPDATA.SPSF" in the root directory of the FAT12 or FAT16 volume. This file is indexed by two previously reserved bytes in the file's (or directory's) directory entry at offset 0x14. In the FAT32 format, these bytes hold the upper 16 bits of the starting cluster number of the file or directory, hence making it impossible to store OS/2 EAs on FAT32 using this method.

However, the third-party FAT32 installable file system (IFS) driver FAT32.IFS version 0.70 and higher by Henk Kelder & Netlabs for OS/2 and eComStation stores extended attributes in extra files with filenames having the string "SPEA.SPSF" appended to the regular filename of the file to which they belong. The driver also utilizes the byte at offset 0x0C in directory entries to store a special mark byte indicating the presence of extended attributes to help speed up things. (This extension is critically incompatible with the FAT32+ method to store files larger than 4 GiB minus 1 on FAT32 volumes.)

Extended attributes are accessible via the Workplace Shell desktop, through REXX scripts, and many system GUI and command-line utilities (such as 4OS2).

To accommodate its OS/2 subsystem, Windows NT supports the handling of extended attributes in HPFS, NTFS, FAT12 and FAT16. It stores EAs on FAT12, FAT16 and HPFS using exactly the same scheme as OS/2, but does not support any other kind of ADS as held on NTFS volumes. Trying to copy a file with any ADS other than EAs from an NTFS volume to a FAT or HPFS volume gives a warning message with the names of the ADSs that will be lost. It does not support the FAT32.IFS method to store EAs on FAT32 volumes.

Windows 2000 onward acts exactly as Windows NT, except that it ignores EAs when copying to FAT32 without any warning (but shows the warning for other ADSs, like "Macintosh Finder Info" and "Macintosh Resource Fork").

Cygwin uses "EASPDATA.SPSF" files as well.

Long file names

One of the user experience goals for the designers of Windows 95 was the ability to use long filenames (LFNs--up to 255 UTF-16 code units long), in addition to classic 8.3 filenames (SFNs). For backward and forward compatibility LFN were implemented as an optional extension on top of the existing FAT file system structures using a workaround in the way directory entries are laid out.

This transparent method to store long file names in the existing FAT file systems without altering their data structures is usually known as VFAT (for "Virtual FAT") after the Windows 95 virtual device driver.

Non VFAT-enabled operating systems can still access the files under their short file name alias without restrictions, however, the associated long file names may get lost, when files with long file names are copied under non VFAT-aware operating systems.

In Windows NT, support for VFAT long filenames started from version 3.5.

GNU/Linux provides a VFAT filesystem driver to work with FAT volumes with VFAT long filenames. For some while, a UVFAT driver was available to provide combined support for UMSDOS-style permissions with VFAT long filenames.

OS/2 added long filename support to FAT using extended attributes (EA) before the introduction of VFAT; thus, VFAT long filenames are invisible to OS/2, and EA long filenames are invisible to Windows, therefore experienced users of both operating systems would have to manually rename the files.

Human68K supported up to 18.3 filenames and (Shift JIS) Kanji characters in a proprietary FAT file system variant.

In order to support Java applications, the FlexOS-based IBM 4690 OS version 2 introduced its own virtual file system (VFS) architecture to store long filenames in the FAT file system in a backwards compatible fashion. If enabled, the virtual filenames (VFN) are available under separate logical drive letters, whereas the real filenames (RFN) remain available under the original drive letters.

Forks and Alternate Data Streams

The FAT file system itself is not designed for supporting Alternate Data Streams (ADS), but some operating systems that heavily depend on them have devised various methods for handling them in FAT drives. Such methods either store the additional information in extra files and directories (classic Mac OS and macOS), or give new semantics to previously unused fields of the FAT on-disk data structures (OS/2 and Windows NT).

Mac OS using PC Exchange stores its various dates, file attributes and long filenames in a hidden file called "FINDER.DAT", and resource forks (a common Mac OS ADS) in a subdirectory called "RESOURCE.FRK", in every directory where they are used. From PC Exchange 2.1 onwards, they store the Mac OS long filenames as standard FAT long filenames and convert FAT filenames longer than 31 characters to unique 31-character filenames, which can then be made visible to Macintosh applications.

macOS stores resource forks and metadata (file attributes, other ADS) using AppleDouble format in a hidden file with a name constructed from the owner filename prefixed with "._", and Finder stores some folder and file metadata in a hidden file called ".DS_Store" (but note that Finder uses .DS_Store even on macOS' native filesystem, HFS+).

UMSDOS permissions and filenames

Early GNU/Linux distributions also supported a format known as UMSDOS, a FAT variant with Unix file attributes (such as long file name and access permissions) stored in a separate file called "--linux-.---". UMSDOS fell into disuse after VFAT was released and it is not enabled by default in Linux from version 2.5.7 onwards. For some time, Linux also provided combined support for UMSDOS-style permissions and VFAT long filenames through UVFAT.


File Allocation Tables Article about File Allocation 7268589 ...
src: slideplayer.com


Derivatives

Turbo FAT

In its NetWare File System (NWFS) Novell implemented a heavily modified variant of a FAT file system for the NetWare operating system. For larger files it utilized a performance feature named Turbo FAT.

FATX

FATX is a family of file systems designed for Microsoft's Xbox video game console hard disk drives and memory cards, introduced in 2001.

While resembling the same basic design ideas as FAT16 and FAT32, the FATX16 and FATX32 on-disk structures are simplified but fundamentally incompatible with normal FAT16 and FAT32 file systems, making it impossible for normal FAT file system drivers to mount such volumes.

The non-bootable superblock sector is 4 KiB in size and holds an 18 byte large BPB-like structure completely different from normal BPBs. Clusters are typically 16 KiB in size and there is only one copy of the FAT on the Xbox. Directory entries are 64 bytes in size instead of the normal 32 bytes. Files can have filenames up to 42 characters long using the OEM character set and be up to 4 GiB minus 1 byte in size. The on-disk timestamps hold creation, modification and access dates and times but differ from FAT: in FAT, the epoch is 1980; in FATX, the epoch is 2000. On the Xbox 360, the epoch is 1980.

exFAT

exFAT is a file system introduced with Windows Embedded CE 6.0 in November 2006 and brought to the Windows NT family with Vista Service Pack 1 and Windows XP Service Pack 3 (and/or separate installation of Windows XP Update KB955704). It is loosely based on the File Allocation Table architecture, but incompatible, proprietary and protected by patents.

exFAT is intended for use on flash drives (such as SDXC and Memory Stick XC), where FAT32 is otherwise used. Microsoft's GUI and command-line format utilities offer it as an alternative to NTFS (and, for smaller partitions, to FAT16B and FAT32). The MBR partition type is 0x07 (the same as used for IFS, HPFS, and NTFS). Logical geometry information located in the VBR is stored in a format not resembling any kind of BPB.

FAT+

In 2007 the open FAT+ draft proposed how to store larger files up to 256 GiB minus 1 byte or 274,877,906,943 (238 - 1) bytes on slightly modified and otherwise backward-compatible FAT32 volumes, but imposes a risk that disk tools or FAT32 implementations not aware of this extension may truncate or delete files exceeding the normal FAT32 file size limit. Support for FAT32+ and FAT16+ is limited to some versions of DR-DOS and not available in mainstream operating systems. (This extension is critically incompatible with the /EAS option of the FAT32.IFS method to store OS/2 extended attributes on FAT32 volumes.)


Write your own Operating System B03: File Allocation Table (FAT32 ...
src: i.ytimg.com


Patents

Microsoft applied for, and was granted, a series of patents for key parts of the FAT file system in the mid-1990s. All four pertain to long-filename extensions to FAT first seen in Windows 95: U.S. patent 5,579,517, U.S. patent 5,745,902, U.S. patent 5,758,352, U.S. patent 6,286,013.

On December 3, 2003 Microsoft announced that it would be offering licenses for use of its FAT specification and "associated intellectual property", at the cost of a US$0.25 royalty per unit sold, with a $250,000 maximum royalty per license agreement. To this end, Microsoft cited four patents on the FAT file system as the basis of its intellectual property claims.

In the EFI FAT32 specification Microsoft specifically grants a number of rights, which many readers have interpreted as permitting operating system vendors to implement FAT.

Non-Microsoft patents affecting FAT include: U.S. patent 5,367,671, specific to the OS/2 extended object attributes (expired in 2011).

Challenges and lawsuits

The Public Patent Foundation (PUBPAT) submitted evidence to the US Patent and Trademark Office (USPTO) in 2004 disputing the validity of U.S. patent 5579517, including prior art references from Xerox and IBM. The USPTO opened an investigation and concluded by rejecting all claims in the patent. The next year, the USPTO further announced that following the re-examination process, it affirmed the rejection of '517 and additionally found U.S. patent 5,758,352 invalid on the grounds that the patent had incorrect assignees.

However, in 2006 the USPTO ruled that features of Microsoft's implementation of the FAT system were "novel and non-obvious", reversing both earlier decisions and leaving the patents valid.

In February 2009, Microsoft filed a patent infringement lawsuit against TomTom alleging that the device maker's products infringe on patents related to VFAT long filenames. As some TomTom products are based on GNU/Linux, this marked the first time that Microsoft tried to enforce its patents against the GNU/Linux platform. The lawsuit was settled out of court the following month with an agreement that Microsoft be given access to four of TomTom's patents, that TomTom will drop support for the VFAT long filenames from its products, and that in return Microsoft not seek legal action against TomTom for the five-year duration of the settlement agreement.

In October 2010, Microsoft filed a patent infringement lawsuit against Motorola alleging several patents (including two of the VFAT patents) were not licensed for use in the Android operating system. They also submitted a complaint to the ITC. Developers of open source software have designed methods intended to circumvent Microsoft's patents.

In 2013, patent EP0618540 "common name space for long and short filenames" was invalidated in Germany.


File Allocation Tables Article about File Allocation 7268589 ...
src: slideplayer.com


See also

  • Comparison of file systems
  • Design of the FAT file system
  • Drive letter assignment
  • List of file systems
  • Transaction-Safe FAT File System

COS 318: Operating Systems File Layout and Directories - ppt video ...
src: slideplayer.com


Notes


File Systems 2: File Allocation - YouTube
src: i.ytimg.com


References


File Allocation Table
src: eej.press


External links

  • Description of the FAT32 File System: Microsoft Knowledge Base Article 154997
  • MS-DOS: Directory and Subdirectory Limitations: Microsoft Knowledge Base Article 39927
  • Overview of FAT, HPFS, and NTFS File Systems: Microsoft Knowledge Base Article 100108
  • Microsoft Technet; Volume and file size limits of FAT file systems, copy made by Internet Archive Wayback Machine of an article with summary of limits in FAT32 which is no longer available on Microsoft website.
  • Chen, Raymond; Microsoft TechNet: A Brief and Incomplete History of FAT32
  • Fdisk does not recognize full size of hard disks larger than 64 GB: Microsoft Knowledge Base Article 263044
  • Microsoft Windows XP: FAT32 File System, copy made by Internet Archive Wayback Machine of an article with summary of limits in FAT32 which is no longer available on Microsoft website.

Source of article : Wikipedia