Principle of FAT file system 4

 

 

    

 Some of the values ​​in Figure 10 will be described: 
    (a) for a short file name, the file name will be stored in two parts, namely, the main file name + extension. Main filename 0x0 ~ 0x7 bytes in the record file extensions 0x8 ~ 0xA log files, ASCII code value is taken in the file name. Not record "." Master file name less than 8 characters in the main file name and extension to whitespace between (20H) filled less than three extensions to the same whitespace characters (20H) padding. If the value at offset 0x0 is 00H, indicate the directory entry is empty; For E5H, indicates that directory entries have been used, but the corresponding file or folder has been deleted. (This is the theoretical basis for the recovery of accidentally deleted). If the file name of the first character to "." Or ".." indicates that the record is a subdirectory of the cluster directory entry. Represents the current directory "."; ".." Represents the parent directory (and we use the mean in dos or windows of the same, if the disk data is corrupted, you can calculate the data on the disk parameters by these two specific directory entry starting position area, guess cluster size, etc., and therefore is more important) 
    (2), attribute fields 0xB: The system can be seen as a byte 0xB divided into eight, with one of them on behalf of a property with or without. Thus, one byte per eight different values ​​can reflect the different values ​​of each attribute. If 00000101 says this is a file attribute is read-only, system. 
    (3), 0xC ~ 0x15 in the definition of the original FAT16 is reserved for future use. In the high version of WINDOWS system is sometimes also used it to record modification and last access time. That the meaning and definition of its field FAT32 is the same, see behind FAT32. 
    (4), the 0x16 ~ 0x17 hours = hours * 2048 + minutes * 32 + s / 2. The results obtained can be converted into hexadecimal fill. That is: 0 to 4 is 2 seconds 0x16 byte units of measure; 0x16 bytes 5 to 7 and 0x17 byte is 0 to 2 minutes; 3 to 7 bytes are 0x17 hours. 
    (5), 0x18 ~ 0x19 The
 date = (year 1980) * 512 + month * 32 + days. The results obtained can be converted into hexadecimal fill. That is: 0x18 byte 0 to 4 is the date number; 0x18 bytes 5 to 7 and 0x19 byte 0 is the month; 1 to 7 0x19 byte to reign, the original definition of 0 to 119 represent From 1980 to 2099, the current version of Windows allows high range from 0 to 127, that is the maximum you can reign to 2107. 
    (6), 0x1A ~ 0x1B store files or directories said first cluster file system to find the first cluster number according to grasp in the FAT table entry, and then tracking the cluster cluster chain until the end, at the same time with 0x1C ~ 0x1F Byte determine effectiveness. Can be completely correct to read files (directory) a. 
    (7), the general process is by addressing the subdirectory parent directory to the specified directory entry, and data files (refer to non-directory files) directory entry is different 0xB offset position of a fourth, and data files 0.

    For the entire FAT partition, the distribution of cluster distribution is not entirely always clean. A data area of 99 sectors FAT system, if the cluster size is set to 2 sectors, the sector will have a cluster can not be allocated to any one. This is the remaining sector of the partition, at the end of the partition. Some DBR system backup of the partition with the last remaining sectors, which is a good backup method. 
    Early FAT16 long file name system does not say, Windows operating system has been fully supported on FAT16 long file names up. 
Long file names and definitions of FAT16 FAT32 long file names are the same, about long file names, FAT32 part in detail to explain .

★ FAT32 storage principle: 
    FAT32 is a very credit file systems, Microsoft successfully designed and used it until today, when the overwhelming hit NTFS, FAT32 Microsoft Windows still occupy an important position in the file system. The earliest is for FAT16 FAT32 does not support large partitions, large capacity unit cluster that dramatically waste of space design faults. Practice, FAT32 or success. 
    FAT32 and FAT16 principle is basically the same, Figure 4.3.12 marked the FAT32 partition basic structure.

 

Figure 4.3.12 Fat32 form of organization
Boot sector The rest of reserved sectors FAT1 FAT2 (repeated) The first cluster root folder All other folders and files The remaining sectors
1 Sector 31 sectors Take the size of the actual situation With FAT1 The first two clusters   Inadequate cluster
Reserved sector     ┗ ━ ━ ━ ━ ━ ━ ━ ━ data area ━ ━ ━ ━ ━ ━ ━ ━ ┛

 

    In the course of FAT32 formatted partition on the characteristics of a good build its DBR, which BPB parameter is very important, you can go back and look at Table 4 and Table 5. First, the number of reserved sectors FAT32 defaults to 32, rather than just a FAT16. This benefit is to help extend the length of the disk DBR instruction, but also leave space for DBR sector backup. We have already mentioned above, built on a FAT32 win98 or win2000, winXP, its operating system boot code is not the only one sector. Leaving excess reserves to expand the sector can be very good OS boot code. BPB also recorded in the sector backup DBR sector number. Backup DBR sector allows us to recover the disk was accidentally destroyed. 
    Data structure FAT32 file allocation table is still the same and FAT16, the difference is, FAT32 cluster binary digits record chain expanded to 32, and therefore such a file system called FAT32. 32-bit binary bits determine the cluster chain FAT table maximum addressable 2T clusters. So even if the cluster size is 1 sector, partition still theoretically capable of addressing the 1TB range. But in practice FAT32 is not addressed such a large space, the size of the partition space increases, the number of records FAT table will become bloated, seriously affect the performance of the system. So in practice, usually not more than 32GB of formatted FAT32 partition. WIN2000 and above OS has no direct support for more than 32GB partition formatted as FAT32, but still can be formatted WIN98 large 127GB FAT32 partition, but this is not necessary nor recommended. At the same time there are small limitations FAT32, FAT32 volume must have at least 65,527 clusters, so for a small partition, still need to use FAT16 or FAT12. 
    Partition becomes large, if the cluster is very small, the file allocation table also becomes larger. Still have the efficiency at the present. Both to read and write large files effectively, but also reduce the maximum possible waste of space. FAT32 also provides for the corresponding partition space corresponds to the size of the cluster, as shown in Table 12:

 

 

Table 12 FAT32 partition size and cluster size on the result
Partition space Each cluster of sectors Cluster space
<8GB 8 4k
> = 8GB and <16GB 16 8k
> = 16GB and <32GB 32 16k
> = 32GB 64 32k

 

    The value and significance of clusters FAT16 is similar, but the median sprinkling fills compared in Table 13:

 

Table 13 FAT system records the value of the meaning of each item (16 hex)
The value of FAT12 entries The value of FAT16 entries The value of FAT32 entries Corresponding cluster performance conditions
000 0000 00000000 Unallocated clusters
002 ~ FFF 0002 ~ FFEF 00000002 ~ FFFFFFEF Assigned cluster
FF0 ~ FF6 FFF0 ~ FFF6 FFFFFFF0 ~ FFFFFFF6 Reserved
FF7 FFF7 FFFFFFF7 Bad clusters
FF8 ~ FFF FFF8 ~ FFFF FFFFFFF8 ~ FFFFFFFF End of file clusters

 


    Another major reform FAT32 is the root directory of the file, ie equivalent to the common root directory file. Such would not be the root of FAT16 limit 512 directory entries, not enough time to increase cluster chain, you can assign an empty cluster. Moreover, the location of the root directory is no longer rigidly fixed, can be stored in any cluster partition addressable, but usually is the first to establish the root directory (the format will generate a) Table of Contents. So, we see the situation is basically the root of the first cluster accounted for the first order of a cluster on the cluster region. Figure 4.3.12 is also in this case by making paintings. 
    FAT32 cluster number remains the same for FAT16. A first sequence number of the second cluster Cluster still generally used (which are different and FAT16 root directory, FAT16 does not account for the root cluster region of space, since the root of the cluster is 32 sectors Area a cluster)      FAT32 and FAT16 file addressing method of the same, but the significance of each parameter byte directory entry, but differ with FAT16, FAT16 one hand, it enabled the directory entries reserved field, while fully supports long file names a.     For short directory entry file format. Significance of its parameters are shown in Table 14: 


 

 

The table below shows the definition of a short 14 FAT32 file directory entry 32 bytes
Byte offset (hexadecimal) Byte count Definitions
0x0 ~ 0x7 8 File Name
0x8 ~ 0xA 3 Extension
0xB * 1 Attribute byte 00000000 (reading and writing)
00000001 (Read Only)
00000010 (hide)
00000100 (System)
00001000 (label)
  00010000 (subdirectories)
00100000 (archive)
0xC 1 Reserved
0xD 1 Creation time of 10 milliseconds bit
0xE ~ 0xF 2 File creation time
0x10 ~ 0x11 2 File creation date
0x12 ~ 0x13 2 File last access date
0x14 ~ 0x15 2 File starting cluster number of 16 high
0x16 ~ 0x17 2 Recent file modification time
0x18 ~ 0x19 2 Last modified date of the file
0x1A ~ 0x1B 2 Low document starting cluster number 16
0x1C ~ 0x1F 4 Length indicates the file

 

 
Domain name: www.mrtlab.com | | Telephone: +86-27-82621261 | Terms of use
MRT data recovery website,provides professional HDD firmware repair and data recovery technical resources!
Copyright 2003-2019 Powered By MrtLab