您的位置:首页 > 移动开发 > 微信开发

翻译windows internals 第12章文件系统

2016-06-06 11:14 369 查看
UDF

The Windows UDF file system implementation is OSTA (Optical Storage Technology Association)UDF-compliant. (UDF is a subset of the ISO-13346 format with extensions for formats such as CD-R and DVD-R/RW.) OSTA defined UDF in 1995 as a format to replace the ISO-9660 format for magnetooptical storage media, mainly DVD-ROM. UDF is included in the DVD specification and is more flexible than CDFS. The UDF file system format has the following traits:

■ Directory and file names can be 254 ASCII or 127 Unicode characters long.

■ Files can be sparse. (Sparse files are defined later in this chapter.)

■File sizes are specified with 64 bits.

■ Support for access control lists (ACLs).

■ Support for alternate data streams.

The UDF driver supports UDF versions up to 2.60. The UDF format was designed with rewritable media in mind. The Windows UDF driver (%SystemRoot%\System32\Drivers\Udfs.sys) provides readwrite support for Blu-ray, DVD-RAM, CD-R/RW, and DVD+-R/RW drives when using UDF 2.50 and read-only support when using UDF 2.60. However, Windows does not implement support for certain UDF features such as named streams and access control lists.

Windows UDF文件系统实现和OSTA UDF 文件系统兼容。UDF是ISO-13346格式的子集,CD-R和DVD-R/RW是该格式的扩展。OSTA在1995年定义了UDF为磁盘存储介质(主要是DVD-ROM)来替换ISO-9660格式,UDF包括在DVD规格中,比CDFS更加灵活,UDF文件系统有如下特征:

目录和文件名可以是254个ASCII码长和127个Unicode长。

文件可以是稀疏的。(稀疏文件在本章后面有讲述)

文件大小指定64位。

支持控制访问列表

支持可选择的数据流。

UDF驱动支持UDF 2.6。

UDF格式被设计为可写的介质。Windows UDF(%SystemRoot%]System32\Driver\Udfs.sys)2.50版本对Blue-ray,DVD-RAM,CD-R/RW和DVD+-R/RW驱动器提供可读写的支持,使用UDF6.0时提供只读的支持。然而,windows并没有提供对某些特征的支持例如:可被命名的流和访问控制列表。

Windows supports the FAT file system primarily for compatibility with other operating systems in multiboot systems, and as a format for flash drives or memory cards. The Windows FAT file system driver is implemented in %SystemRoot%\System32\Drivers\Fastfat.sys. The name of each FAT format includes a number that indicates the number of bits that the particular

format uses to identify clusters on a disk. FAT12’s 12-bit cluster identifier limits a partition to storing a maximum of 212 (4,096) clusters. Windows permits cluster sizes from 512 bytes to 8 KB, which limits a FAT12 volume size to 32 MB。

FAT12,FAT16,和FAT32

Windows支持FAT格式文件系统主要用于与多重引导系统中的和其他操作系统的兼容性,并作为闪存驱动器或内存卡的格式,WindowsFAT文件系统驱动实现在%SystemRoot%\system32\Drivers\Fastfat.sys.

每一个FAT格式的名字包括一个数字标志特定格式的位数来识别磁盘上的簇。FAT12的12位标识符限制某个分区最大存储4096个磁盘簇。Windows允许簇大小从512字节到8KB,这限制了FAT12卷的大小最大为32MB。

Note All FAT file system types reserve the first two clusters and the last 16 clusters of avolume, so the number of usable clusters for a FAT12 volume, for instance, is slightly lessthan 4,096.

注意:所有FAT文件系统类型保留最开始的两个磁盘簇和一个卷的最后16个磁盘簇,因此FAT12卷的可以使用的磁盘簇的数目稍微少于4096.

FAT16, with a 16-bit cluster identifier, can address 216 (65,536) clusters. On Windows, FAT16 cluster sizes range from 512 bytes (the sector size) to 64 KB (on disks with a 512-byte sector size), which limits FAT16 volume sizes to 4 GB. Disks with a sector size of 4,096 bytes allow for clusters of 256 KB. The cluster size Windows uses depends on the size of a volume. The various sizes are listed in Table 12-1. If you format a volume that is less than 16 MB as FAT by using the format command or the Disk Management snap-in, Windows uses the FAT12 format instead of FAT16.

FAT16,有16位簇标识符,可以寻址65536个磁盘簇。在Windows平台上,FAT16磁盘簇的大小从512字节(扇区的大小)到64KB(在512字节扇区大小的磁盘上),这限制了FAT16卷的大小最大为4GB。扇区大小为4096字节的允许256KB大小的磁盘簇。Windows使用的磁盘簇的大小依赖于卷的大小。表12-1列举了不同情况的大小。如果想通过格式化命令或者磁盘管理插件格式化小于16MB的卷为FAT格式,Windwos将使用FAT12而不是FAT16.



A FAT volume is divided into several regions, which are shown in Figure 12-2. The file allocation table, which gives the FAT file system format its name, has one entry for each cluster on a volume. Because the file allocation table is critical to the successful interpretation of a volume’s contents, the FAT format maintains two copies of the table so that if a file system driver or consistency-checking program (such as Chkdsk) can’t access one (because of a bad disk sector, for example), it can read from the other.

FAT卷被分为一些不同的区域,如图12-2所示。文件分配表给出了文件系统格式的名字,对于卷上的每一个磁盘簇都有一个条目。因为文件分配表对成功解释卷的内容至关重要,FAT文件格式保持该表的两份复制,如此,当一个文件系统的驱动或者持续检测程序不能访问其中的一个(例如由于磁盘坏块),他可以从另外一个读取。



Entries in the file allocation table define file-allocation chains (shown in Figure 12-3) for files and

directories, where the links in the chain are indexes to the next cluster of a file’s data. A file’s directory entry stores the starting cluster of the file. The last entry of the file’s allocation chain is the reserved value of 0xFFFF for FAT16 and 0xFFF for FAT12. The FAT entries for unused clusters have a value of

0. You can see in Figure 12-3 that FILE1 is assigned clusters 2, 3, and 4; FILE2 is fragmented and uses clusters 5, 6, and 8; and FILE3 uses only cluster 7. Reading a file from a FAT volume can involve reading large portions of a file allocation table to traverse the file’s allocation chains.

在文件分配表中的条目为文件和子目录定义了文件分配链(如图12-3所示),(这里的where仅仅连接两句话并没有实际的意义个人理解)链条中的链是一个文件数据下一个簇的索引。一个文件的目录项存储改文件的起始簇。文件分配链条中的最后一个条目对于FAT16是0XFFFF,对于FAT12是0xFFF。FAT条目中对于未使用的簇的值是0。图12-3显示文件1分配了簇2,3,和4.文件2占用了簇5,6,8,(fragmented这里指的簇号不不相邻),文件3仅仅使用簇7.从FAT卷中读入一个文件涉及到都一个文件分配表的大部分来遍历文件分配链。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息