Traditional Culture Encyclopedia - Traditional virtues - Linux hard disk partition command Linux hard disk partition

Linux hard disk partition command Linux hard disk partition

What is the function of linux hard disk partition?

Data security: main aspects: only one partition is used. If you need to reinstall the system or format the partition, the original important files can't be saved on this hard disk. If the partition is reasonable in advance, the user data will not be affected.

Efficiency (I don't know much about the commonly used solid-state hard disks at present): Main aspects: Partitioning concentrates data on a sector of a magnetic column. When this partition has data to read, the hard disk will only search the corresponding sector, which is helpful for data reading.

What is the first partition of ide hard disk in Linux partition?

It's hda 1.

For example, the first partition of the first IDE hard disk under Linux is mapped to hda 1, and the second partition is called hda2. For SCSI hard disk, it is sda 1, sdb 1 and so on.

A partition has the same system directory and is also installed in different disk partitions.

The situation is different under Linux, which itself has more partitions-such as root partition/exchange partition. To be more clear, when you installed Linux, you didn't consider how much space there was under the windows partition, because the space under the windows partition was unusable. You need to create a new partition outside the Windows partition.

What is the default partition of Linux?

1 and Linux are divided into three partitions by default, namely boot partition, swap partition and root partition.

(1) boot partition

This partition corresponds to the /boot directory, which is about 100MB. This partition stores the Grub (boot loader) and kernel source code of Linux. Users can access this partition by accessing the /boot directory. In other words, the user's operation on the /boot directory is to operate the partition.

(2) Exchange partition

This partition has no corresponding directory, so users cannot access it.

The swap partition under Linux is virtual memory. Virtual memory is used to store temporary data in the swap partition when the system memory space is insufficient, wait for a period of time, and then transfer the data into memory for execution. Therefore, virtual memory only temporarily stores data and does not execute in this space.

Ps: virtual memory

Virtual memory refers to simulating an area on the hard disk as memory, so the actual physical address of virtual memory is still on the hard disk. Virtual memory or swap partition can only be accessed by the system, and its size is twice that of physical memory.

(3) Root partition

In the Linux operating system, all directories except the /boot directory correspond to this partition. Therefore, users can access this partition by accessing all directories except the /boot directory.

How many primary partitions can a Linux disk have at most?

Both windows and linux systems need to follow the following rules.

There are three types of 1 partitions: main partition extended partition logical partition.

The main partition can be divided into four blocks at most (this is the result of hard disk structure).

There can only be one extended partition on a hard disk.

There can only be four main partitions plus extended partitions.

5 The extended partition cannot write data.

6 Extended partitions can only contain logical partitions.

Linux default partition?

Reasonable planning zoning:

1. One of the partition structures: four main partitions without extended partitions.

Namely:

In this case, if you want to divide more than five partitions on a disk, it won't work.

2. Three main partitions and one extended partition.

Namely:

|

......

This situation works, and the degree of freedom of zoning is relatively large; Partition is also unconstrained and can be divided into more than 5 partitions.

3. The most reasonable partition structure should be that the main partition comes first, the extended partition comes last, and then the logical partition is divided in the extended partition. The number of main partitions+the number of extended partitions should be controlled within four.

Namely:

|

......

Or:

|

......

Or:

|

......

4. The most unreasonable partition structure: the main partition surrounds the extended partition.

|

......

There is freedom between this and, but what about the latter? Unless the main partition 4 makes full use of the space after the extended partition, you can't draw another partition after the main partition 4, let alone divide the logical partition; Although this method also conforms to the standard of four main partitions of a disk, it is really not advisable to divide the main partitions around the extended partition.