?? 新建 文本文檔.txt
字號:
(一)FAT32 文件系統將邏輯盤的空間劃分為三部分,依次是引導區(BOOT區)、文件分配表區(FAT區)、數據區(DATA區)。引導區和文件分配表區又合稱為系統區。
(二)引導區從第一扇區開始,使用了三個扇區,保存了該邏輯盤每扇區字節數,每簇對應的扇區數等等重要參數和引導記錄。之后還留有若干保留扇區。而FAT16文件系統的引導區只占用一個扇區,沒有保留扇區。
三)文件分配表區共保存了兩個相同的文件分配表,因為文件所占用的存儲空間(簇鏈)及空閑空間的管理都是通過FAT實現的,FAT如此重要,保存兩個以便第一個損壞時,還有第二個可用。文件系統對數據區的存儲空間是按簇進行劃分和管理的,簇是空間分配和回收的基本單位,即,一個文件總是占用若干個整簇,文件所使用的最后一簇剩余的空間就不再使用,而是浪費掉了。
從統計學上講,平均每個文件浪費0.5簇的空間,簇越大,存儲文件時空間浪費越多,利用率越低。因此,簇的大小決定了該盤數據區的利用率。FAT16系統簇號用16位二進制數表示,從0002H到FFEFH個可用簇號(FFF0H到FFFFH另有定義,用來表示壞簇,文件結束簇等),允許每一邏輯盤的數據區最多不超過FFEDH(65518)個簇。FAT32系統簇號改用32位二進制數表示,大致從00000002H到FFFFFEFFH個可用簇號。FAT表按順序依次記錄了該盤各簇的使用情況,是一種位示圖法。
每簇的使用情況用32位二進制填寫,未被分配的簇相應位置寫零;壞簇相應位置填入特定值;已分配的簇相應位置填入非零值,具體為:如果該簇是文件的最后一簇,填入的值為FFFFFF0FH,如果該簇不是文件的最后一簇,填入的值為該文件占用的下一個簇的簇號,這樣,正好將文件占用的各簇構成一個簇鏈,保存在FAT表中。0000000H、00000001H兩簇號不使用,其對應的兩個DWORD位置(FAT表開頭的8個字節)用來存放該盤介質類型編號。FAT表的大小就由該邏輯盤數據區共有多少簇所決定,取整數個扇區。
(四)FAT32系統一簇對應8個邏輯相鄰的扇區,理論上,這種用法所能管理的邏輯盤容量上限為16TB(16384GB),容量大于16TB時,可以用一簇對應16個扇區,依此類推。FAT16系統在邏輯盤容量介于128MB到256MB時,一簇對應8個扇區,容量介于256MB到512MB時,一簇對應16個扇區,容量介于512MB到1GB時,一簇對應32個扇區,容量介于1GB到2GB時,一簇對應32個扇區,超出2GB的部分無法使用。顯然,對于容量大于512MB的邏輯盤,采用FAT32的簇比采用FAT16的簇小很多,大大減少了空間的浪費。
但是,對于容量小于512MB的盤,采用FAT32雖然一簇8個扇區,比使用FAT16一簇16個扇區,簇有所減小,但FAT32的FAT表較大,占用空間較多,總數據區被減少,兩者相抵,實際并不能增加有效存儲空間,所以微軟建議對小于512M的邏輯盤不使用FAT32。
另外,對于使用FAT16文件系統的用戶提一建議,硬盤分區時,不要將分區(邏輯盤)容量正好設為某一區間的下限,例:將一邏輯盤容量設為1100M(稍大于1024M),則使用時其有效存儲容量比分區為950M的一般還少,因其簇大一倍,浪費的空間較多。還有,使用FDISK等對分區指定容量時,由于對1MB的定義不一樣(標準的二進制的1MB為1048576B,有的系統將1MB理解為1000000B,1000KB等),及每個分區需從新磁道開始等因素,實際分配的容量可能稍大于指定的容量,亦需注意掌握。
【責任編輯:Noker】
32-bit File Allocation Table
The purpose of the FAT has not changed. It still acts as a table for linking the clusters of a file together. File/Directory entries point to the first cluster in the file which the operating system uses to find the first entry in the FAT. The FAT then tracks the location of the remaining clusters in the file. The entries are twice the size (4 bytes) and you can hold many more clusters on a FAT32 drive.
With the 16-bit FAT, the quantity of clusters on a drive is 65,525 (216 with 10 reserved). With a 32-bit FAT, the highest 4 bits of the 32-bit values are reserved and are not part of the cluster number. Therefore, the maximum amount of clusters on a 32-bit FAT is: 268,435,445 (228 with 10 reserved).
Stepping Through a FAT32 Entry
The starting cluster given in the file/directory entry tells the operating system where to find the first piece of that file. The starting cluster also tells the operating system where to look in FAT32 for the next cluster number. The entry for a starting cluster in a file entry is in bold below.
49 4F 20 20 20 20 20 20-44 4F 53 07 00 00 00 00 IO SYS.....
00 00 00 00 00 00 80 32-3E 1B 02 00 46 9F 00 00 .......2....F...
Two additional entries are used in the 32-bit directory entry. These two entries are taken from a reserved area and in this example are shown above as 00 00. Together with the existing 2 byte entry (02 00), there is a four-byte entry (00 00 00 02) to search the FAT. The following is a sample tracing of the file in a 32-bit FAT:
F8 FF FF 0F FF FF FF 0F-03 00 00 00 04 00 00 00
05 00 00 00 06 00 00 00-07 00 00 00 08 00 00 00
09 00 00 00 0A 00 00 00-0B 00 00 00 0C 00 00 00
0D 00 00 00 0E 00 00 00-0F 00 00 00 10 00 00 00
11 00 00 00 12 00 00 00-13 00 00 00 14 00 00 00
15 00 00 00 16 00 00 00-17 00 00 00 18 00 00 00
19 00 00 00 1A 00 00 00-1B 00 00 00 FF FF FF F8
As with FAT16, F8 is the media descriptor byte. The next 7 bytes, FF FF 0F FF FF FF 0F, are reserved. The clusters are grouped in 4 byte numbers as:
03 00 00 00, 04 00 00 00, 05 00 00 00, 06 00 00 00
And so on. Invert the numbers to read:
00 00 00 03, 00 00 00 04, 00 00 00 05, 00 00 00 06
And so on, to trace the file through the FAT. (The contents in the second entry is 00 00 00 03. F8 FF FF FF, and FF FF FF 0F are grouped as entries 0 and 1 respectively.) The new end of file marker is FF FF FF F8.
How Win.com Determines Improper Shutdown
Of the first 112 bytes of the FAT32, the first 8 bytes are reserved. The eighth byte of the reserved area, by default, is 0F. The virtual file allocation table (VFAT) and the Windows 98 shutdown process manipulate the fourth bit of this byte to 1 or 0.
0 = VFAT has written to disk
1 = Windows has properly shutdown
When you write a file to the disk, VFAT handles the write. During the write, VFAT clears the fourth bit to 0 (07h). When Windows 98 exits properly, this bit is reset to 1. During reboot, Win.com reads that bit. If it is set to 0, it runs ScanDisk to check the drive for errors.
Hard Sector Error. Windows 98 detects a hard sector error during startup. This process toggles the third bit to zero (0Bh). When detected during startup, Windows 98 automatically launches ScanDisk with a surface scan test.
Disabling ScanDisk at Boot. There is a way to disable the improper shutdown check. It is in the Msdos.sys file under [OPTIONS]. The parameters for AutoScan are as follows:
Value Definition
AUTOSCAN = 0 Ignore the bits in the reserved FAT entry
AUTOSCAN = 1 Default behavior, run ScanDisk
Mirroring
On all FAT drives, historically, there are two copies of the FAT. If an error occurs reading the primary copy, the file system will attempt to read from the backup copy. On 12-bit and 16-bit FAT drives, the first FAT is always the primary copy and a modification is automatically written to the second copy. When a second FAT is written to as a backup, the process is called mirroring.
On new FAT32 drives, mirroring a secondary FAT can be disabled. This means that a read/write is quicker using one FAT, or if the first FAT is sitting on corrupted sectors, the second FAT can be used as a primary with the first FAT ignored.
Note On FAT32 drives, a FAT can be very large. Disabling duplicate FAT writes can make FAT access quicker. Windows 98 does not provide a mechanism for eliminating the use of a second FAT. Mirroring is always enabled. Third-party utilities, however, might include this ability as users with larger hard disks might want to disable a second FAT to speed disk access. Any issues about mirroring should be directed to that third-party utility.
Root Directory
With FAT32, the limitation is now 65,535 root directory entries.
There is a new entry in the Boot Sector that points to the first cluster of the root directory. The root directory is no longer forced to reside at a specific location after the second FAT and it can grow just like a subdirectory.
There is a trade off in performance when you have a large number of directory entries to pass across when searching for actual data. For this reason, it is recommended that you limit the number of root directory entries to a small, manageable number. There is no actual recommended size for the same reasons as there is no optimal cluster size to choose from.
Extensions Changed, Superseded, or No Longer Supported
The following list presents some areas where FAT32 may be incompatible with legacy software:
Share services are a part of the installable file system (IFS) manager. VFAT uses them to provide full file sharing functionality. All MS-DOS-based, Win16-based, and Win32-based applications have full file sharing services available to them. As a consequence, the MS-DOS utility Share.exe is no longer necessary and is not provided in Windows 98.
VFAT implements an enhanced version of FASTOPEN. As such, the MS-DOS FASTOPEN utility is no longer necessary, but can install without error.
Windows 3.x File Manager is not supported since it may misreport free or total disk space.
File Control Block (FCB) has limited support but this should not be a problem.
Dealing with files larger than 2 GB (opening, creating, writing) may cause problems on non-FAT32-aware programs.
Absolute disk reads and write utilities should be upgraded to recognize FAT32.
Users should not dual-boot Windows 98 with FAT32 and Windows NT 4.0.
Interlink does not work on FAT32.
Windows 98 partition types not recognized by Windows NT.
When you set up Windows NT on a computer that has Windows 98 preinstalled, the FAT partitions may be shown as unknown.
Windows NT cannot recognize primary partitions using the FAT32 format. Backup any data that you might need to save and then delete the partition(s) using Fdisk from either MS-DOS or Windows 98.
Windows 98 supports four partition types for FAT file systems that Windows NT cannot recognize. The partition type can be identified by the System ID byte in the partition table. This byte is located at the following offsets:
0x1C2 = Partition 1
0x1D2 = Partition 2
0x1E2 = Partition 3
0x1F2 = Partition 4
The four values used by Windows 98 that Windows NT does not recognize are as follows:
0x0B Primary Fat32 Partitions up to 2047 GB
0x0C Same as 0x0B, uses Logical Block Address Int 0x13 extensions
0x0E Same as 0x06, uses Logical Block Address Int 0x13 extensions
0x0F Same as 0x05, uses Logical Block Address Int 0x13 extensions
The FAT partition types that Windows NT version 3.x and 4.0 can recognize are:
0x01 Fat12 < 10 megabytes
0x04 Fat16 < 32 megabytes
0x06 Fat16 > 32 megabytes
0x05 Extended (may be FAT, HPFS or NTFS)
此問題由李海回答。
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -