Analysis of the Principle and Method of Implementing Linux Disk Partition

Analysis of the Principle and Method of Implementing Linux Disk Partition

remember:

IDE disk: the first disk is hda, the second disk is hdb...

The first partition of the first disk is hda1, the second partition is hda2...

SAS/SATA/SCSI disk: The first disk is sda, the second disk is sdb...

The first partition of the first disk is sda1, the second partition is sda2...

The general partition is located at /dev/sda1.

What is Partitioning

Disk partitioning is equivalent to partitioning the disk.

Disk partition type

1. Primary partition (primary) P

1) The partition that must exist in the system, the system disk selects the primary partition for installation

2) The digital number can only be 1-4. sda1, sda2, sda3, sda4

3) The number of primary partitions is at most four and at least one.

2. Extend partition E

1) Equivalent to an independent small disk. Independent partition table cannot exist independently.

2) Have an independent partition table.

3) Cannot exist independently, that is, cannot store data directly

4) Logical partitions must be created on the extended partition to store data

5) The total number of primary partitions (primary partition + extended partition) occupied is up to 4

3. Logical partition (logic)

1) The numbering can only start from 5

2) Stored on the extended partition

3) Store any common data

Disk partitioning method

①1~4 primary partitions

② There can be at most one extended partition, and 2 ≤ extended partitions + primary partitions ≤ 4

How disk partitioning works

Disks are partitioned by cylinder. (Increase reading and writing speed)

Where disk partitions are registered: disk partition table. (Stores partition result information, location: track 0, head 0, sector 1)

The first 446 bytes of a sector (system boot information), followed by 64 bytes (partition table), and the last two bytes (partition end mark).

A partition information occupies a fixed 16 bytes, so there can only be 64/16=4 partitions.

The key to disk partitioning is to modify the 64-byte partition table.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • An article to understand Linux disks and disk partitions
  • How to implement Linux disk mounting, partitioning, and capacity expansion operations
  • Linux system disk formatting and manually adding swap partition
  • Detailed explanation of Linux virtual machine root partition disk expansion space record
  • Linux disk partitioning practical examples (must read)
  • Detailed process of LINUX disk partitioning, formatting, mounting and uninstalling
  • How to use GPT partitioning on Linux disks larger than 2T
  • Linux parted disk partition implementation steps analysis

<<:  Vue implements dynamic circular percentage progress bar

>>:  How to clear mysql registry

Recommend

Detailed installation process of mysql5.7.21 under win10

This article shares the installation of MySQL 5.7...

Detailed explanation of html-webpack-plugin usage

Recently, I used html-webapck-plugin plug-in for ...

Discussion on default margin and padding values ​​of common elements

Today we discussed the issue of what the margin v...

Vue's guide to pitfalls using throttling functions

Preface In a common business scenario, we need to...

Steps to install MySQL 8.0.23 under Centos7 (beginner level)

First, let me briefly introduce what MySQL is; In...

How to make a website look taller and more designed

“How to make a website look high-end? Or more des...

Example of CSS3 to achieve div sliding in and out from bottom to top

1. First, you need to use the target selector of ...

Several ways to shut down Hyper-V service under Windows 10

When using VMware Workstation to open a virtual m...

Detailed explanation of component development of Vue drop-down menu

This article example shares the specific code for...

HTML table tag tutorial (24): horizontal alignment attribute of the row ALIGN

In the horizontal direction, you can set the row ...