Storage Organization Structure of the FAT32 File System (2): fat32 Organization Structure

Source: Internet
Author: User

Storage Organization Structure of the FAT32 File System (2): fat32 Organization Structure

We have analyzed the structure of FAT32 File System Storage Based on A formatted empty USB flash disk. Next we will analyze the operating mechanism of the file system from the perspective of file operations. Because I changed a USB flash drive, several important data areas of the just-formatted empty USB flash drive are still pasted as follows:

 

As we can see, during partition formatting, the system stores the file size TEST_FAT32 in cluster 2, that is, the directory area, as shown in the root directory texture above. At the same time, the file Terminator FF 0F is written to the position marked by the FDT Zone 2 cluster. Obviously, the FAT32 file system treats directories as common files.

Next we will create a new folder TEST1 in the root directory to see what changes will happen:

After the TEST1 folder is created, FDT becomes as follows:

The root directory is changed to the following:

Cluster 3 is reassigned:

From the above changes, we can intuitively see that the system has completed the following actions when creating a folder:

A. Create a new directory item in the cluster where the parent directory is located to store the folder information currently created.

B. allocate a new cluster and create two directory items for the new Folder: parent directory and current directory.

C. Write the file terminator at the corresponding location of the newly allocated cluster in the FDT table.

D. establish the link relationship between each part: Write the cluster number of the newly allocated cluster in the file starting cluster number field of the Directory item corresponding to the new folder, the file starting cluster number field of the two directory items on the new cluster is allocated with the cluster number of the parent directory (0 here, I thought it was 2, that is, the cluster where the root directory is located. I don't know why, it may be used to indicate the root directory with 0) and the current cluster number (3 here ).

To verify the correctness of the above analysis, we create a new folder named TEST11 in the TEST1 folder to check whether the following operations are performed:

A. Create a new directory item in the parent directory (TEST1) Cluster (cluster 3) to store the TEST11 Folder Information.

B. assign a new cluster (which should be cluster 4) and create two directory items for the new folder (TEST11): parent directory and current directory.

C. Write the file terminator at the corresponding location of the newly allocated cluster (which should be cluster 4) in the FDT table.

D. establish the link relationship between each part: Create the file starting cluster number field of the Directory item corresponding to the folder (TEST11) and write the cluster number of the newly allocated cluster (which should be cluster 4 ),, the file start cluster number field of the two directory items on the new cluster is allocated with the cluster number (cluster 3) of the parent directory and the current cluster number (which should be cluster 4 ).

After creating the TEST11 folder, The FDT becomes:

The root directory has not changed:

Cluster 3 becomes:

New cluster 4:

Obviously, our estimation is correct and further proves that our previous analysis is correct.

Next we will analyze the file creation situation

We first create a 100-byte file TEST. TXT, and then copy the file to the root directory of the USB flash drive. The FDT is changed to the following:

The root directory is changed:

New cluster 5 is assigned to save the file content:

From the above changes, we can intuitively see that the operations performed by the system to create a file are the same as those performed by creating a folder:

A. Create a new directory item in the cluster where the parent directory is located to store the file information currently created.

B. allocate a new cluster to store the content of the new file.

C. Write the file terminator at the corresponding location of the newly allocated cluster in the FDT table.

D. Establish a link: Write the cluster number of the newly allocated cluster to the file starting cluster number field of the Directory item corresponding to the new file.

Conclusion:

1. In the FAT32 file system, directories and files are stored in a unified manner.

2. The operating unit of the file system is a cluster. Every time a file or folder is created, at least one cluster number will be assigned again.

3. If the content of a file or directory needs to be stored in multiple clusters, the system will allocate multiple clusters to store the content of files or directories.

4. When multiple clusters are required, these clusters may be continuous or discontinuous, but the system uses the FDT linked list form to organize them.


Q: What is the difference between the NTFS and FAT32 file systems? Which one is better?

File Allocation Table (FAT)
A file system that organizes and manages files by MS-DOS and other Windows operating systems. The file allocation table (FAT) is a data structure created by Windows when you format a specific volume using the FAT or FAT32 file system. In Windows, file-related information is stored in FAT for future file retrieval.

FAT32
A file system derived from the file allocation table (FAT) file system. Compared with FAT, FAT32 supports smaller clusters and larger capacity, thus allocating disk space more efficiently on FAT32 volumes.

NTFS file system
An advanced file system that provides performance, security, reliability, and advanced features not available in various FAT versions. For example, NTFS ensures volume consistency through the standard transaction log feature and recovery technology. If the system fails, NTFS can use log files and checkpoint information to restore file system consistency. In Windows 2000 and Windows XP, NTFS also provides advanced features such as file and folder permissions, encryption, disk quotas, and compression.

Select NTFS, FAT, and FAT32

On a computer running Windows XP, you can select from three file systems for disk partitioning: NTRS, FAT, and FAT32. NTFS is a file system that is strongly recommended for use. Compared with FAT or FAT32, NTFS has more powerful functions and includes functions required for Active Directory and other important security features. Only when NTFS is selected as the file system can you use features such as Active Directory and domain-based security.

NTFS and FAT32 options
Win 2000 supports both FAT32 and NTFS file systems. FAT32 is longer compatible with Win 9X and NTFS is longer than system security. On the premise of meeting the application requirements, how can we set up a file system to make full use of the features of Win 2000? Before discussing this issue, let's take a look at the features of the FAT32 and NTFS file systems.
FAT32 File System
Before the introduction of the FAT32 file system, the file system usually used by the PC is FAT16. Like MS-DOS, Win 95 and other systems are using the FAT16 file system. In Windows 9X, FAT16 supports a maximum partition size of 2 GB. We know that the computer stores the information in a zone called a "cluster" on the hard disk. The smaller the cluster used, the higher the information storage efficiency. In the case of FAT16, the larger the partition, the larger the cluster, the lower the storage efficiency, and the waste of storage space. With the continuous improvement of computer hardware and applications, the FAT16 file system cannot meet the requirements of the system. In this case, the enhanced File System FAT32 is introduced. Compared with FAT16, FAT32 has the following features:
1. the maximum advantage of FAT32 compared with FAT16 is that it supports 2 TB (2047 GB) disks, but cannot support partitions smaller than MB. FAT32-based Win 2000 supports a maximum partition size of 32 GB, while FAT16-based Win 2000 supports a maximum partition size of 4 GB.
2. Because smaller clusters are used, the FAT32 file system can store information more efficiently. For example, if both partitions are 2 GB in size, one partition uses the FAT16 file system, and the other uses the FAT32 file system. The cluster size in FAT16 is 32 KB, while that in FAT32 is only 4 kb. In this way, the storage efficiency of FAT32 is much higher than that of FAT16, which can be improved by 15%.
3. The FAT32 file system can locate the root directory and use the FAT backup copy. In addition, the startup records of the FAT32 partition are included in a structure containing key data, reducing the possibility of computer system crashes.
NTFS file system
NTFS file system is a security-based file system, which is unique in Windows NT... the rest of the text>

The format of my computer's hard drive file system is FAT32, not NTFS. What are the differences between the two file systems?

Converting a non-system disk to NTFS format does not affect one-click restoration. one-click restoration software can only restore a fat32 system disk. Therefore, we recommend that you do not convert a C: disk to NTFS.
The following method can be used to convert the data into ntfs partitions without damaging the original data.
Do not power off during conversion

Click Start> Run, Enter cmd, and press enter to open the Command Prompt window. Enter "convert F:/FS: NTFS/V" in the command prompt, and press Enter. "F:" Here is the partition of the file system to be converted, the "V" parameter indicates that the detailed information is displayed during conversion. You can skip this parameter. When you restart your computer, WinXP will automatically convert the F: disk to the NTFS file system (the related process will be displayed before entering the system) and then enter the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.