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

MySQL learning database operation DML detailed explanation for beginners

Table of contents 1. Insert statement 1.1 Insert ...

A practical record of troubleshooting a surge in Redis connections in Docker

On Saturday, the redis server on the production s...

CSS animation combined with SVG to create energy flow effect

The final effect is as follows: The animation is ...

js implements mouse switching pictures (without timer)

This article example shares the specific code of ...

Detailed explanation of Java calling ffmpeg to convert video format to flv

Detailed explanation of Java calling ffmpeg to co...

A brief discussion on logic extraction and field display of Vue3 in projects

Table of contents Logical Layering Separate busin...

How to configure Openbox for Linux desktop (recommended)

This article is part of a special series on the 2...

Two ways to correctly clean up mysql binlog logs

mysql correctly cleans up binlog logs Preface: Th...

Example of horizontal arrangement of li tags in HTMl

Most navigation bars are arranged horizontally as...

Typical cases of MySQL index failure

Table of contents Typical Cases Appendix: Common ...

Design Tips: We think you will like it

<br />Looking at this title, you may find it...

Ideas and codes for implementing waterfall flow layout in uniapp applet

1. Introduction Is it considered rehashing old st...

MySQL Database Basics SQL Window Function Example Analysis Tutorial

Table of contents Introduction Introduction Aggre...