FAT File System


The FAT file system locates the file allocation table near the beginning of the volume. FAT16 works best on small disks with simple folder structures. FAT32 works well on large disks with complex folder structures. Both FAT file systems store two copies of the file allocation table on the volume. If one copy of the file allocation table is corrupted, the other is used. The location of the file allocation table is specified in the FAT boot sector s BIOS Parameter Block (BPB). For more information about the FAT boot sectors, see Troubleshooting Disks and File Systems in this book.

Note 

Windows XP Professional uses the Fastfat driver to mount and fully support FAT volumes.

Comparing FAT File Systems

The numerals in the names FAT12, FAT16, and FAT32 refer to the number of bits required for a file allocation table entry as follows:

  • FAT12 uses a 12-bit file allocation table entry (212 clusters).

  • FAT16 uses a 16-bit file allocation table entry (216 clusters).

  • FAT32 uses a 32-bit file allocation table entry. However, FAT32 reserves the first 4 bits of a FAT32 file allocation table entry, which means FAT32 has a theoretical maximum of 228 clusters.

Note 

In Windows XP Professional, FAT12 is used only on floppy disks and on volumes smaller than 16 megabytes.

There are additional advantages and disadvantages between FAT16 and FAT32.

Advantages of FAT16

Advantages of FAT16 include:

  • MS DOS, Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, Windows XP, and some UNIX operating systems can use FAT16.

  • Many software tools can address problems and recover data on FAT16 volumes.

  • If you have a startup failure, you can start the computer by using an MS DOS bootable floppy disk to troubleshoot the problem.

  • FAT16 is efficient, in speed and storage, on volumes smaller than 256 MB.

Disadvantages of FAT16

Disadvantages of FAT16 include:

  • The root folder can manage a maximum of 512 entries. The use of long file names can significantly reduce the number of available entries.

  • FAT16 is limited to 65,536 clusters, but because certain clusters are reserved, it has a practical limit of 65,524. Therefore, the largest FAT16 volume on Windows XP Professional is limited to just under 4 GB and uses a cluster size of 64 KB. To maintain compatibility with MS DOS, Windows 95, Windows 98, and Windows Me, a FAT16 volume cannot be larger than 2 GB.

  • FAT16 is inefficient on larger volume sizes because the cluster size is much larger when compared to NTFS and FAT32 cluster sizes. For example, a 10-KB file stored on a 1.2-GB FAT16 volume, which uses a 32-KB cluster, wastes 22 KB of disk space. FAT32 and NTFS use 4-KB and 2-KB clusters, respectively, for a 1.2-GB volume.

  • The boot sector, a critical disk structure for starting your computer, is not backed up.

  • FAT16 has no built-in file system security or compression scheme.

Advantages of FAT32

FAT32 has the following enhancements:

  • The root folder on a FAT32 volume is an ordinary cluster chain and can be located anywhere on the volume. For this reason, FAT32 does not restrict the number of entries in the root folder.

  • FAT32 uses smaller clusters (4 KB for volumes up to 8 GB), so it allocates disk space more efficiently than FAT16. Depending on the size of your files, FAT32 creates the potential for tens and even hundreds of megabytes of additional free disk space on larger volumes compared to FAT16.

  • The boot sector is backed up at a specified location on the volume, so FAT32 volumes are less susceptible to single points of failure than FAT16 volumes.

Disadvantages of FAT32

Disadvantages of FAT32 include:

FAT16 File System

FAT16 is included in Windows XP Professional for the following reasons:

When relatively small files are placed on a FAT16 volume, FAT16 manages disk space inefficiently. Therefore, FAT16 is not recommended for volumes larger than 511 MB, and you cannot use FAT16 on volumes larger than 4 gigabytes (GB).

start sidebar
Using FAT12 in Windows XP Professional

On volumes with fewer than 32,680 sectors, the cluster sizes can be up to 8 sectors per cluster. In this circumstance, the format program creates a 12-bit FAT. Typically, volumes less than 16 MB are formatted for a 12-bit FAT, but the exact size depends on the disk geometry. The disk geometry also determines when a larger cluster size is needed because the number of clusters on the volume must fit into the number of bits used by the file system managing the volume. Therefore, you might have a 33-MB volume that has only 1 sector (512 bytes) per cluster.

FAT12 is the original implementation of FAT and is intended for very small media. The file allocation table for FAT12 is smaller than the file allocation table for FAT16 and FAT32, because it uses less space for each entry, leaving more space for data. All 1.44-MB 3.5-inch floppy disks are formatted by using FAT12.

end sidebar

Figure 13-17 illustrates how FAT16 maps clusters on a volume. The file allocation tables (labeled FAT1 and FAT2) identify each cluster in the volume as one of the following:

The root folder has the maximum number of available entries fixed at 512. The maximum number of entries on a floppy disk depends on the size of the disk.

Note 

Each folder and 8.3 file name in the root folder counts as an entry. For example, because the maximum number of entries is fixed at 512, if you have 100 folders in the root folder, you can create only 412 more files or folders in the root folder. If those folders or files use names longer than the 8.3 format, fewer files and folders can be created.

Folders contain a 32-byte entry for each file and folder they contain. The entry includes the following information:

In the file allocation table of a FAT16 volume, files are given the first available location on the volume. The starting cluster number is the address of the first cluster used by the file. Each cluster contains a pointer to the next cluster in the file, or an end-of-file indicator at (0xFFFF), which indicates that this cluster is the end of the file. These pointers and end-of-file indicators are shown in Figure 13-18.

click to expand
Figure 13-18: Files on a FAT volume

Figure 13-18 shows three files in a folder. File1.txt uses three clusters. File2.txt is a fragmented file that requires three clusters. File3.txt fits in one cluster. In each case, the file allocation table entry points to the first cluster of the file.

The information in the folder is used by all operating systems that support FAT. Windows XP Professional can store additional timestamps in a FAT folder entry. These timestamps show when the file was created or last accessed.

The attribute byte for each entry in a folder describes what kind of entry it is. For example, one bit indicates that the entry is for a subfolder, and another bit marks the entry as a volume. Typically, the operating system controls the settings of these bits.

The attribute byte includes four bits that can be turned on or off by the user archive, system, hidden, and read-only.

FAT32 File System

The FAT32 on-disk format and features on Windows XP Professional are similar to those on Windows 95 OSR2, Windows 98, and Windows Me.

The size of a FAT32 cluster is determined by the system and can range in size from 1 sector (512 bytes) to 128 sectors (64 KB), incremented in powers of 2.

Note 

Using 64-KB clusters in FAT32 can lead to compatibility problems with certain programs. The maximum cluster size recommended for a FAT32 volume is 32 KB.

Because FAT32 requires 4 bytes to store cluster values, many internal and on-disk data structures have been revised or expanded. Most programs are unaffected by these changes; however, disk tools that read the on-disk format must be updated to support FAT32.

The most significant difference between FAT16 and FAT32 is the maximum number of clusters supported, which in turn affects a volume s maximum size and storage efficiency. FAT32 breaks the 4-GB volume limitation of FAT16 by extending the maximum number of clusters.

Due to the greater number of available clusters within FAT32, each cluster can be made smaller for a particular volume, increasing the efficiency of data storage. For example, FAT16 volumes between 2 and 4 GB use a 64-KB cluster, whereas FAT32 volumes between 16 GB and 32 GB use a 16-KB cluster.

Note 

The 127.5-GB limit on FAT32 volumes imposed in Windows 98 no longer applies to Windows Me. In Windows Me, using a cluster size of 32 KB, a FAT32 volume can theoretically be about 8 terabytes. However, the 32-bit fields in the partition table (and in the FAT32 boot sector) limit the size of an individual volume (regardless of file system) on a basic MBR disk using a sector size of 512 bytes to approximately 2 terabytes.

Although Windows 2000 and Windows XP Professional can mount FAT32 volumes of any size, Windows 2000 and Windows XP Professional can format FAT32 volumes up to 32 GB only. Use NTFS to format larger volumes. For more information about the benefits of formatting Windows XP Professional volumes by using NTFS, see Advantages of Using NTFS earlier in this chapter.

The largest possible file for a FAT32 volume is 4 GB minus 1 byte. FAT32 contains 4 bytes per cluster in the file allocation table; FAT16 contains 2 bytes per cluster; and FAT12 contains 1.5 bytes per cluster. A FAT32 volume must have at least 65,527 clusters. For more information about clusters, see Cluster Size earlier in this chapter.

File Names on FAT Volumes

Files created or renamed on FAT volumes use attribute bits to support long file names in a way that does not interfere with how MS DOS gains access to the volume.

When you create a file that has a long file name, Windows XP Professional creates a conventional 8.3 name for the file and one or more secondary folder entries for the file, one for each set of 13 characters in the long file name. Each secondary folder entry stores a corresponding part of the long file name in Unicode. MS DOS accesses the file by using the conventional 8.3 file name contained in the folder entry for the file.

Windows XP Professional marks the secondary folder entries as part of a long file name by setting the volume ID, read-only, system, and hidden attribute bits. MS DOS typically ignores folder entries with all these attribute bits set.

Figure 13-19 shows all of the folder entries for the file Thequi~1.fox, which has a long name of The quick brown.fox. The long name is in Unicode, so each character in the name uses 2 bytes in the folder entry. The attribute field for the long-name entries has the value 0x0F. The attribute field for the short name has the value 0x20.

click to expand
Figure 13-19: Long file name on a FAT volume

Note 

Windows NT and Windows XP Professional do not use the same algorithm to create long and short file names as Windows 95, Windows 98, and Windows Me. However, on computers that use a multiple-boot configuration to start these operating systems, files that you create while running one operating system can be accessed while running another.

For more information about how Windows XP Professional creates short file names, see File Names in Windows XP Professional later in this chapter.

By default, Windows XP Professional supports long file names on FAT volumes. You can disable long file names on FAT volumes if you use MS-DOS based disk tools regularly on the computer. These tools might either eliminate the long file names created by Windows XP Professional or delete the files that have long file names.

To prevent a FAT file system from creating long file names, set the value of the Win31FileSystem registry entry (in the subkey HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Control\FileSystem) to 1. This value prevents Windows XP Professional from creating new long file names on all FAT volumes. However, existing long file names remain intact but are not displayed in My Computer, Windows Explorer, or at the command prompt.

Caution 

Do not edit the registry unless you have no alternative. The registry editor bypasses standard safeguards, allowing settings that can damage your system, or even require you to reinstall Windows. If you must edit the registry, back it up first and see the Registry Reference in the Microsoft Windows 2000 Server Resource Kit at http://www.microsoft.com/reskit




Microsoft Windows XP Professional Resource Kit 2003
Microsoft Windows XP Professional Resource Kit 2003
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 338
BUY ON AMAZON

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net