Linux Partitioning and Formatting

a disk partition

Disk partitioning is the use of a partition editor to divide a disk into logical sections. Once the disc is divided into several partitions (Partition), different types of directories and files can be stored in different partitions.
 
Two-partition type
Primary partition: There can only be 4 at most, which is determined by the structure of the hard disk.
The hard disk is divided into sectors of equal size, each sector is 512 bytes, 446 bytes are used to record boot information, and the remaining 64 bytes are used for partition representation, and every 16 bytes is used for partition representation. Bytes represent one partition, so it can only represent up to 4 partitions.
Extended partition: Take one primary partition out as an extended partition.
1. There can only be one at most.
2. There are up to 4 primary partitions plus extended partitions.
3. Data cannot be written, only logical partitions can be included.
logical partition
A sample partition diagram is as follows:


 
 
Three formatting
Formatting (Advanced Formatting), also known as logical formatting, refers to writing specific data in a specific area of ​​the disk according to the file system (FAT16, FAT32, NTFS, EXT2, EXT3, EXT4, etc.) selected by the user. Delineate a piece of disk space in the partition to store file management such as file allocation table and directory table.
FAT16: The largest partition can only support 2G.
FAT32: A single file cannot exceed 4G.
Formatting process:
1. Format the partition into data blocks of equal size. This data block is 4KB by default, and of course it can be adjusted to 1KB or 2KB.
2. Delineate a piece for storing the file allocation table and directory table for managing files.
The image below shows the partition situation after the partition is formatted.


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326188942&siteId=291194637