Can linux recognize fat32?

WBOY
Release: 2022-07-26 16:27:01
Original
4437 people have browsed it

Linux system can recognize the fat32 format by default; some versions of Red Hat Linux also provide limited support for FAT32, and most Linux distribution kernels support the FAT32 file system. FAT32 refers to the file allocation table using 32-bit Disk file management method of binary number record management.

Can linux recognize fat32?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Can linux recognize fat32

Linux system can recognize fat32 u disk by default, but cannot recognize ntfs format u disk

Most linux distributions The kernel supports the FAT32 file system.

Some versions of Red Hat Linux also provide limited support for FAT32, but please note that if Linux is installed in a FAT32 partition, a floppy disk must be used for booting.

If you want to mount a FAT32 format disk partition, you only need to use the mount command to load it.

What is fat32

FAT is the abbreviation of File Allocation table. FAT32 means that the file allocation table is managed using 32-bit binary number records. Disk file management method

Because the core of the FAT file system is the file allocation table, the name comes from this. FAT32 is developed from FAT and FAT16. It has the advantages of good stability and compatibility, is fully compatible with Win 9X and previous versions, and is easy to maintain. The disadvantage is that it has poor security and can only support a maximum partition of 32GB, and a single file can only support a maximum of 4GB.

Disk structure

When using the FAT32 file system to manage the hard disk, the maximum capacity of each partition that can be supported can reach 128TB. [6] The internal space of each logical disk using the FAT32 file system can be divided into three parts, namely the boot area (BOOT area), the file allocation table area (FAT area), and the data area (DATA area). The boot area and file allocation table area are collectively called the system area, which occupies a small space at the front of the entire logical disk and stores relevant management information. The data area is the area used by the logical disk to store file contents. This area is allocated in clusters.

Boot Sector

The first sector of the FAT32 file system is the boot sector, which stores a lot of specific information about a file system, such as the FAT table Number, size of each FAT table (number of sectors), number of bytes in each sector, number of sectors contained in each cluster, number of reserved sectors, file system size (number of sectors), root The starting cluster number of the directory and some other additional information. The boot area (BOOT area) uses three sectors starting from the first sector (logical sector number 0), and saves the number of bytes per sector of the logical disk, the number of sectors corresponding to each cluster, and other important parameters and boot Record. There are still a number of reserved sectors left, including backups of one to three sectors.

File allocation table area

The file allocation table area (FAT area) is FAT The file system manages the most important area of disk space and files. It saves the usage information of each cluster in the logical disk data area and uses the bitmap method to represent it. The storage space occupied by files and the management of free space are all implemented through FAT. The FAT area saves two identical file allocation tables, so that when the first one is damaged, the second one is available. The size of the FAT table is determined by how many clusters there are in the data area of the logical disk, and is an integer number of sectors. The usage of each cluster in the data area can be known by looking up its filling value at the corresponding position in the FAT table. Each cluster in the FAT32 table occupies four bytes (32 bits), indicating that the first 8 bytes (0H-07H bytes) are used to store the disk media type number, so the effective cluster number starts from 02H. The usage of cluster 02H is indicated by a 32-bit binary number consisting of 08H-0BH bytes, the usage of cluster 03H is indicated by a 32-bit binary number consisting of 0CH-0FH bytes, and so on. Write zero in the corresponding position of the cluster that has not been allocated and recycled, fill in the corresponding position of the bad cluster with the specific value 0FFFFFF7H, and fill in the corresponding position of the allocated cluster with a non-zero value, specifically: if the cluster is the last cluster of the file, The value filled in is 0FFFFFFH. If the cluster is not the last cluster of the file, the value filled in is the cluster number of the next cluster occupied by the file. In this way, each cluster occupied by the file forms a cluster chain and is saved in FAT32 table.

Data area

The data area is used to store user data. It is located behind FAT2 and is also divided into clusters. Numbering starts from 2, which is cluster 2. The starting position is the real starting position of the data area.

(1) Root directory

Usually the root directory is located in cluster 2, but in principle the root directory in the FAT32 file system can be located anywhere in the data area. The root directory area saves the directory entries of each file in the root directory, and each directory entry occupies 32 bytes. In the FAT32 file system, the root directory is part of the data area and is managed in a similar way to subdirectories. This is obviously different from FAT12 and FAT16. For example, the root directory area (ROOT area) of the FAT16 file system is a fixed area and fixed size. , occupying the 32 sectors immediately following the FAT area, and can store up to 512 directory entries (this is why the number of files saved in the root directory is limited), as part of the system area.

(2) Subdirectory

In the FAT32 file system, except for the root directory, all subdirectories are created according to specific needs during use. If a new subdirectory is created under the root directory, the subdirectory is said to be a subdirectory of the root directory, and the root directory is said to be the parent directory of the subdirectory. When a subdirectory is created, a directory entry is created in the cluster assigned to its parent directory. The directory entry describes the starting cluster number of the directory, and a cluster is allocated for it in the free space and cleared. The cluster number is recorded in its directory entry. When a directory entry is created for a subdirectory, the first two directory entries are used in the cluster allocated for the subdirectory to record its relationship with the corresponding parent directory.

(3) Directory items

Due to different structures, the FAT32 file system generally divides directory entries into four types: volume label directory entries, "." directory entries and ".." directory entries , short file name directory entry, long file name directory entry. The short file name directory entry stores basic information such as the short file name, attributes, starting cluster number, time value, and content size of the subdirectory or file.

Extended knowledge

If you want to mount a FAT32 formatted disk partition, you only need to use the mount command to load it.

1. Use the fdisk command to check partition and USB device information.

[root@wgods ~]# fdisk -l
Copy after login

Can linux recognize fat32?

2. From the above information, you can see that the USB device is in FAT32 format and is identified as /dev/sdb1

[root@wgods ~]# fdisk -l | grep FAT32 /dev/sdb1 * 56 640 3580928 c W95 FAT32 (LBA)
Copy after login

3. In the mnt directory First create a USB directory

[root@wgods ~]# cd /mnt/ [root@wgods mnt]# mkdir usb
Copy after login

4. Mount the U disk

[root@wgods mnt]# mount -t vfat /dev/sdb1 /mnt/usb
Copy after login

After the mounting is successful, you can see the relevant content under /mount/usb.

Recommended learning:Linux video tutorial

The above is the detailed content of Can linux recognize fat32?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!