The root directory of FAT12 and FAT16 volumes is preassigned enough space at the start of a volume to store 256 directory entries, which places an upper limit on the number of files and directories that can be stored in the root directory. (There’s no preassigned space or size limit on FAT32 root directories.) A FAT directory entry is 32 bytes and stores a file’s name, size, starting cluster, and
time stamp (last-accessed, created, and so on) information. If a file has a name that is Unicode or that doesn’t follow the MS-DOS 8.3 naming convention, additional directory entries are allocated to store the long file name. The supplementary entries precede the file’s main entry. Figure 12-4 shows a sample directory entry for a file named “The quick brown fox.” The system has created a THEQUI~1.FOX 8.3 representation of the name (that is, you don’t see a “.” in the directory entry because it is assumed to come after the eighth character) and used two more directory entries to store the Unicode long file name. Each row in the figure is made up of 16 bytes.
FAT12和FAT16卷的根目录在卷的开始处预留了足够大的空间来存放256个子目录的条目,这里设置了可以存放在根目录中的文件和子目录的上限。(在FAT32文件系统中名没有并没有预留空间和尺寸上限)。FAT目录项为32字节,存储了文件的名字,大小,起始簇,时间戳信息。如果一个文件的名字是Unicode类型或者名不遵循MS-DOS8.3的命名传统,额外的目录项被分配存储长文件名,补充的条目在文件主条目的前面,图12-4显示文件名为“the quick brown fox”的目录项。系统已经创建文件名为THEQUI~1.FOX
8.3的文件(你并没有在目录项中看到“.”,因为它被假设在第8个字符之后),使用额外的两个目录项来存储Uincode长文件名,每一行都有16个字节。
FAT32使用32位的簇标识符但是保留了高四位,因此实际上簇标识符是28位,因为FAT32簇大小可以是64KB的大小,FAT32理论上可以寻址16TB的卷。尽管windows系统使用FAT32大小更大的卷(创建在其它操作系统中),他限制了FAT32卷最大为32GB。FAT32 高位潜在的簇数字使它比FAT16管理磁盘更加有效,它可以处理高达128GB的卷大小,该卷的簇大小为512字节,表12-2显示FAT32卷的默认磁盘簇大小。
除了高位的簇限制,其他FAT32比FAT12和FAT16更好的地方包括:FAT32的更目录没有预先存储在卷的 预先定义的位置上,根目录并没有在尺寸上设置界限,FAT32基于稳定性存储了启动扇区的备份。FAT32和FAT16都限制了文件的最大尺寸是4GB,因为子目录存储文件大小是32位值。
翻译windows internals 第12章文件系统(持续更新)
最新推荐文章于 2020-10-28 22:46:31 发布
