The FAT file system locates the file allocation table near the beginning of the volume. FAT16 was designed for small disks and simple folder structures. FAT32 allowed users to create large volumes on large disks. Two copies of the file allocation table are stored on the volume. In the event that one copy of the file allocation table is corrupted, the other is used. The file allocation table is stored in a byte offset specified in the FAT boot sector's BIOS Parameter Block (BPB) so that the files needed to start the system can be located.
NOTEFAT32 can automatically implement the backup file allocation table if the primary file allocation table is damaged. FAT16 volumes require that a disk repair tool, such as Chkdsk, be used to implement the backup file allocation table.
FAT16 is included in Windows 2000 for the following reasons:
It provides backward compatibility in the form of an upgrade path for earlier versions of Windows-compatible products.
It is compatible with most other operating systems.
FAT16 is not recommended for volumes larger than 511 MB; when relatively small files are placed on a FAT16 volume, FAT16 manages disk space inefficiently. You cannot use FAT16 on volumes larger than 4 gigabytes (GB).
NOTEOn 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. Volumes less than 16 MB are usually 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 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 with FAT12.
Figure 17.3 illustrates how FAT16 maps clusters on a volume. The file allocation tables (labeled FAT1 and FAT2 in Figure 17.3) identify each cluster in the volume as one of the following:
Unused
Cluster in use by a file
Bad cluster
Last cluster in a file
Figure17.3 Organization of a FAT16 Volume
The root folder exists at a specified location and 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.
NOTEEach folder and 8.3 file name in the root folder counts as an entry. For example, since the maximum number of entries is fixed at 512, if you have 100 folders in the root folder, you can only create 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:
Name in 8.3 format (11 bytes)
Attribute (1 byte, described later in this section)
Create time (3 bytes)
Create date (2 bytes)
Last access date (2 bytes)
Last modified time (2 bytes)
Last modified date (2 bytes)
Starting cluster number in the file allocation table (2 bytes)
File size (4 bytes)
NOTEThree bytes in each entry are held in reserve.
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 17.4.
Figure17.4 Files on a FAT Volume
Figure 17.4 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 2000 can store additional timestamps in a FAT folder entry. These timestamps show when the file was created or last accessed.
Because all entries in a folder are the same size, 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.
Support for FAT32 is new in Windows 2000. The FAT32 on-disk format and features on Windows 2000 are similar to those on Windows 95 OSR2 and Windows 98.
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.
NOTEThe use of 64 KB clusters in FAT32 can lead to compatibility problems with certain programs. The maximum recommended size cluster for a FAT32 volume is 32 KB.
Since 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 which 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 to over 4 million. FAT32, as implemented in Windows 2000, can mount a volume as large as 127 GB. Due to the greater number of available clusters within FAT32, each cluster can be made smaller for a particular volume, making data storage more efficient. If you have a FAT16 volume between 2 and 4 GB in size, a 64-KB cluster is used; with FAT32, volumes ranging in size between 256 MB and 8 GB use a 4-KB cluster.
The largest possible file for a FAT32 volume is 4 GB minus 2 bytes. 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, but no more than 4,177,918 clusters.
In Windows 2000, you cannot format FAT32 volumes greater than 32 GB. Use NTFS to format larger volumes. For more information about why it is recommended that you format all Windows 2000 volumes with NTFS, see "NTFS File System" earlier in this chapter.
NOTEThe Windows 2000 Fastfat driver enables you to mount and fully support a FAT32 volume larger than 32 GB that was created by another operating system.
Files created or renamed on FAT volumes use attribute bits to support LFNs in a way that does not interfere with how MS-DOS gains access to the volume.
Whenever you create a file with an LFN, Windows 2000 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 LFN. Each secondary folder entry stores a corresponding part of the LFN in Unicode. MS-DOS accesses the file by using the conventional 8.3 file name contained in the folder entry for the file.
Windows 2000 marks the secondary folder entries as part of an LFN by setting the volume ID, read-only, system, and hidden attribute bits. MS-DOS generally ignores folder entries with all these attribute bits set, so these entries are invisible to it.
Figure 17.5 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.
Figure17.5 LFN on a FAT Volume
NOTEWindows NT and Windows 2000 do not use the same algorithm to create long and short file names as Windows 95 and Windows 98. However, on computers that use a multiple-boot process to start these operating systems, files that you create when running one operating system can be accessed when running another.
For more information about how Windows 2000 creates short file names, see "Using Long File Names" later in this chapter.
By default, Windows 2000 supports LFNs on FAT volumes. You can prevent a FAT file system from creating LFNs by setting the value of the Win31FileSystem registry entry (in subkey HKEY_LOCAL_MACHINESystem CurrentControlSetControlFileSystem) to 1. This value prevents Windows 2000 from creating new LFNs on all FAT volumes, but it does not affect existing LFNs.
WARNINGDo not use a registry editor to edit the registry directly unless you have no alternative. The registry editors bypass the standard safeguards provided by administrative tools. These safeguards prevent you from entering conflicting settings or settings that are likely to degrade performance or damage your system. Editing the registry directly can have serious, unexpected consequences that can prevent the system from starting and require that you reinstall Windows 2000. To configure or customize Windows 2000, use the programs in Control Panel or Microsoft Management Console (MMC) whenever possible.
FAT16 works the same in Windows 2000 as it does in MS-DOS, Windows 3.x, Windows 95, and Windows 98. FAT32 works the same in Windows 2000 as it does in Windows 95 OSR2 and Windows 98. You can install Windows 2000 on an existing FAT primary volume or logical volume. When running Windows 2000, you can move or copy files between FAT and NTFS volumes.
NOTEIf you copy a file from an NTFS volume to a FAT volume, any NTFS-specific properties associated with that file, such as permissions, compression, encryption, and sparse file support, are permanently lost.
You cannot use Windows 2000 with any compression or partitioning software that requires disk drivers to be loaded by MS-DOS, Windows 95, or Windows 98. Therefore, you cannot use DoubleSpaceâ, DriveSpaceâ, or DriveSpaceâ 3 on a FAT16 primary volume or logical volume that you want to access when running Windows 2000.