Linux learning-3. Disk partition during Linux system installation

Disk partition during Linux system installation

1. Disk partition

Disk partitioning is to use the partition editor to divide several logical parts on the disk. Once the disc is divided into several partitions (Partition), different types of directories and files can be stored in different partitions.

2. Partition type

1. Primary partition: only 4 at most

2. Extended partition: there can be only one at most, main + extended at most 4, can not write data, can not format, can only contain logical partitions
Partition

1, 2, 3 are primary partitions, 4 are extended partitions, 5, 6 are logical partitions (not restricted by Linux, hard disk rules)
Logical partitions: data can be written and formatted

3. Formatting (advanced formatting) is
also called logical formatting. The purpose of formatting is to write the "file system" in the hard disk. The purpose of writing
to the "file system" is to divide the hard disk into equal-sized data blocks block
Win —Fat16, Fat32, NTFS
Linux—EXT2, EXT3, EXT4 (4K size)
Insert picture description here

For example: 10K data is randomly placed into 3 4k blocks, and
the purpose of disk data arranging is to organize relevant data together as much as possible

Linux: Take the device file name for each hard disk-partition the hard disk-format-take a hardware file name for each partition-set the mount point (drive letter)

Four. Hardware device file name

After formatting, take a hardware device file name for each piece of hardware (all hardware in Linux is a file)
Insert picture description here
/ root directory (equivalent to "My Computer")
/dev first-level subdirectory, all devices and hardware files are saved Go to this directory (for example: /dev/sda)
Example: hda The first IDE hard disk sda The first SATA hard disk or USB hard disk

5. Partition device file name
/dev/hda1 (IDE hard disk interface)
/dev/sda1 (SCSI hard disk interface, SATA hard disk interface)

The partition of one hard disk means the partition of
Insert picture description here
multiple hard disks.
Insert picture description here
VI. Mount: (assign the drive letter, the drive letter is the mount point)

Mount: connect the device file name (hardware) with the mount point (empty directory name)

The empty directory name is used as
the partition of the drive letter Linux. The reason why everyone has a headache is that it does not assign an "letter drive letter" to each partition, but uses a specific folder name to "mount" , To distinguish between functions.

Must be partitioned :

/ (Root partition)
Swap partition (swap partition) memory 2 times, no more than 2GB (virtual memory)

Recommended partition

/boot (boot partition, 200mb) the kernel of the operating system and the files used in the process of booting the system
/home the location of the user's home directory

Insert picture description here

According to the above figure, the hard disk space corresponding to the analysis file name
/write data is put into sda3 hard disk space
/boot write data is put into sda1 hard disk space
/home write data is put into sda2 hard disk space
from Linux system Look, /boot /home belongs to the /root directory.
From the hard disk, each one can have its own independent hard disk space.

Summary
Partition: Divide the large hard disk into small logical partitions
Format: Write to the file system
Partition device file name: Define the device file name
for each partition Mount: Assign a mount point to each partition

The above is the content of the partition.

Cheer for the author!

Guess you like

Origin blog.csdn.net/sison1999/article/details/114907943