...
Anchor |
---|
1004014 | 1004014 | Organization of the File Allocation Table Anchor |
---|
1004015 | 1004015 | The File Allocation Table is a map of all the clusters that make up the data area of the volume. The FAT does not “know” the location of the first cluster that has been allocated to a given file. It does not even know the name of any files. That information is stored in the directory.
Anchor |
---|
1004016 | 1004016As described in the section above, the directory entry for each file contains a value called a cluster address. This is a pointer to the first entry in the File Allocation Table for a given file. This FAT entry in turn points to the first cluster in the volume’s data area that has been allocated to the file.anchor
1004017 | 1004017 | If the file has been allocated more than one cluster, then the FAT table entry will contain the address of the second cluster (which is also the index number of the second cluster’s entry in the FAT table). The second cluster entry points to the third, and so forth. A FAT entry like this forms a linked list commonly called a cluster chain.
Anchor |
---|
1004021 | 1004021 | Figure 10-3 Figure - File Allocation Table and Directory Entry relationship illustrates the relationship between the directory entry and the FAT.
anchor...
...
...
title | Figure - File Allocation Table and Directory Entry relationship |
---|
|
Image Added |
In the figure above, the directory entry for a file points to the 40th entry in the FAT table. The 40th entry points to the 41st, the 41st to the 46th; the 46th is not a pointer, as the entry contains a special end-of-cluster-chain marker. The This means that for Figure 10-3, the 41st cluster is the final cluster allocated to the file.
Anchor |
---|
1004040 | 1004040 | Other entries in the FAT area
in illustrated Figure 10-3 illustrated in the figure above are either not allocated to a file, or allocated to a file whose cluster chain is terminated by the 43rd entry.
Anchor |
---|
1004041 | 1004041 | To summarize, a cluster’s entry in the File Allocation Table typically contains a pointer to the entry for the next cluster in a file’s cluster chain.
Anchor |
---|
1004042 | 1004042Other values that can be stored in a cluster’s entry in the FAT are special markers for: Anchor |
---|
1004043 | 1004043 | - End-of-cluster-chain: this cluster is the final cluster for a file.
...
...
- Cluster-not-allocated (free cluster mark): no file is using this cluster.
...
- Damaged-cluster: this cluster cannot be used.
...
1004046 | 1004046 | NOTE: Updating the FAT table is time consuming, but updating it frequently is very important. If the FAT table gets out of sync with its files, files and directories can become corrupted, resulting in the loss of data (see
section 10-6 “Optional Journaling System” on page 127 Optional Journaling System).