Microsoft Windows XP Professional Resource Kit 2003

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:

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:

Disadvantages of FAT16

Disadvantages of FAT16 include:

Advantages of FAT32

FAT32 has the following enhancements:

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).

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.

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.

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.

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

Категории