### 1. Tracks, Sectors, Cylinders, and Number of Heads
The most basic component of a hard disk is a disk platter made of a hard metal material and coated with a magnetic medium. The number of platters varies depending on the hard disk capacity. Each platter has two sides, both of which can record information. The platter is divided into many fan-shaped areas, each area is called a sector, and each sector can store 128×2^N (N = 0, 1, 2, 3) bytes of information. In DOS, each sector is 128×2^2 = 512 bytes. On the surface of the platter, concentric circles with different radii centered on the center of the platter are called tracks. In a hard disk, cylinders are formed by tracks of the same radius on different platters. Tracks and cylinders both represent circles of different radii. In many cases, tracks and cylinders can be used interchangeably. We know that each disk has two sides, and each side has one head. The head number is usually used to distinguish them. The number of sectors, tracks (or cylinders), and heads constitutes the basic parameters of the hard disk structure. With these parameters, the capacity of the hard disk can be obtained. The calculation formula is:
Storage capacity = number of heads × number of tracks (cylinders) × number of sectors per track × bytes per sector
Key points:
(1) A hard disk has several platters. Each platter has two sides, and each side has one head.
(2) The platter is divided into multiple fan-shaped areas, namely sectors.
(3) Concentric circles of different radii on the same platter are tracks.
(4) Cylinders are formed by tracks of the same radius on different platters.
(5) Formula: Storage capacity = number of heads × number of tracks (cylinders) × number of sectors per track × bytes per sector
(6) Information recording can be expressed as: ×× track (cylinder), ×× head, ×× sector
(7) Hard disk capacity = number of cylinders (CYLINDER) × number of heads (HEAD) × number of sectors (SECTOR) × 512B
### 2. A hard disk can have at most four primary partitions
The MBR (Master Boot Recorder) is the main boot sector, which stores information about the hard disk. The MBR can be said to be the most important part of the entire hard disk because it records two important things inside: the boot manager program and the disk partition table (partition table). So the hard disk partitioning we do is to modify the partition table.
Because the capacity of this MBR block is limited, when it was initially designed, it was only designed to have 4 partition records (this statement is not very accurate, and there will be a detailed explanation below). These partition records are called Primary (primary partitions) and Extended (extended partitions). That is to say, a hard disk can have at most 4 Primary + Extended sectors. Among them, there can be only one Extended. Therefore, if you want to partition into four disk partitions, then the maximum situation is:
P + P + P + P
P + P + P + E
for partitioning. It should be specially noted that in the above situation, 3P + E only has three "usable" disks. If you want all four to be "usable", you need to partition into 4P! (Because the Extended cannot be used directly, it needs to be partitioned into Logical first)
Thought 1: If I want to temporarily partition my large hard disk into four partitions, and there is still other space for me to plan in the future, how should I partition?
From the above explanation, we can know that Primary + Extended can have at most four partitions. And if you want to have more than 5 partitions, then you need the help of Extended. Therefore, in this example, we must never partition into four Primary. Why? Suppose you have a 20 GB hard disk, and 4 primary partitions have used up 15 GB. You think there is still 5 GB available, right? Wrong! The remaining 5 GB cannot be used at all because there are no more partition table record areas to record, so additional partitioning cannot be carried out, and of course the space is wasted. Therefore, please pay special attention. If you want to partition more than 4 slots, please remember that there must be an Extended partition area, and all remaining space must be allocated to Extended, and then the space of Extended is planned with Logical partitions.
Thought 2: Can I only partition 1 Primary and 1 Extended?
Of course you can! Basically, there can be 64 Logical partitions. Therefore, you can only partition one primary partition, and allocate all other partitions to Extended, and use Logical partitions to plan other partitions!
Thought 3: Suppose my hard disk is installed on IDE 1's Master, and I want to partition into 6 usable hard disk sectors, then what are the codes of each disk under Linux?
Explanation:
Since the Primary + Extended of the hard disk can have at most four, under Linux, partition numbers 1 to 4 have been reserved first. If only 2 P + E are used, then two partition numbers will be vacant! To explain in more detail, suppose I have used up all four P + E. Among them, the Extended /dev/hda4 includes three logical partitions.
The actually usable ones are /dev/hda1, /dev/hda2, /dev/hda3, /dev/hda5, /dev/hda6, /dev/hda7 these six partitions! As for the Extended sector /dev/hda4 itself, it is only used to plan the disk space available for Logical.
Then what if I only want to partition 1 Primary and 1 Extended?
Because numbers 1 to 4 have been reserved, the code of the first Logical starts from number 5, and the ones planned later are increased in a cumulative way. Among them, /dev/hda3 and /dev/hda4 are empty and reserved codes.
This problem will be more accurately explained in combination with history. Why can there be at most four main partitions, which is not only determined by the operating system.
First, why is a sector only 512 bytes, why not 1024 bytes?
First of all, I want to say that the size of a sector can be defined by itself (by the hard disk manufacturer), and it can be 1024 bytes. So the fact that a sector is 512 bytes is not a theoretical value, but a habitual value. That is to say, the size of a sector being 512 bytes has been habitually defined by hard disk manufacturers, and no one wants to change this habit.
Second, the first sector of the hard disk can be divided into three parts: the first part is MBR, which needs to occupy 446 bytes, and the second part is DPT, which needs to occupy 64 bytes. This is because one partition table needs to occupy 16 bytes, 64/16 = 4, so it can just store the tables of four partitions. This is why there can be only four partitions. The remaining two bytes are used to store the end mark. So
446 + 64 + 2 = 512 bytes.
In fact, encrypting the hard disk is to rewrite the last two bytes of the end mark.
Imagine if the hard disk manufacturer had set a sector to 1024 bytes at the beginning, would there still be only four partitions? Logical drives also need partition tables, which are stored in the first sector of the extended partition, so logical drives are not arbitrarily divided as many as you want.
The most basic component of a hard disk is a disk platter made of a hard metal material and coated with a magnetic medium. The number of platters varies depending on the hard disk capacity. Each platter has two sides, both of which can record information. The platter is divided into many fan-shaped areas, each area is called a sector, and each sector can store 128×2^N (N = 0, 1, 2, 3) bytes of information. In DOS, each sector is 128×2^2 = 512 bytes. On the surface of the platter, concentric circles with different radii centered on the center of the platter are called tracks. In a hard disk, cylinders are formed by tracks of the same radius on different platters. Tracks and cylinders both represent circles of different radii. In many cases, tracks and cylinders can be used interchangeably. We know that each disk has two sides, and each side has one head. The head number is usually used to distinguish them. The number of sectors, tracks (or cylinders), and heads constitutes the basic parameters of the hard disk structure. With these parameters, the capacity of the hard disk can be obtained. The calculation formula is:
Storage capacity = number of heads × number of tracks (cylinders) × number of sectors per track × bytes per sector
Key points:
(1) A hard disk has several platters. Each platter has two sides, and each side has one head.
(2) The platter is divided into multiple fan-shaped areas, namely sectors.
(3) Concentric circles of different radii on the same platter are tracks.
(4) Cylinders are formed by tracks of the same radius on different platters.
(5) Formula: Storage capacity = number of heads × number of tracks (cylinders) × number of sectors per track × bytes per sector
(6) Information recording can be expressed as: ×× track (cylinder), ×× head, ×× sector
(7) Hard disk capacity = number of cylinders (CYLINDER) × number of heads (HEAD) × number of sectors (SECTOR) × 512B
### 2. A hard disk can have at most four primary partitions
The MBR (Master Boot Recorder) is the main boot sector, which stores information about the hard disk. The MBR can be said to be the most important part of the entire hard disk because it records two important things inside: the boot manager program and the disk partition table (partition table). So the hard disk partitioning we do is to modify the partition table.
Because the capacity of this MBR block is limited, when it was initially designed, it was only designed to have 4 partition records (this statement is not very accurate, and there will be a detailed explanation below). These partition records are called Primary (primary partitions) and Extended (extended partitions). That is to say, a hard disk can have at most 4 Primary + Extended sectors. Among them, there can be only one Extended. Therefore, if you want to partition into four disk partitions, then the maximum situation is:
P + P + P + P
P + P + P + E
for partitioning. It should be specially noted that in the above situation, 3P + E only has three "usable" disks. If you want all four to be "usable", you need to partition into 4P! (Because the Extended cannot be used directly, it needs to be partitioned into Logical first)
Thought 1: If I want to temporarily partition my large hard disk into four partitions, and there is still other space for me to plan in the future, how should I partition?
From the above explanation, we can know that Primary + Extended can have at most four partitions. And if you want to have more than 5 partitions, then you need the help of Extended. Therefore, in this example, we must never partition into four Primary. Why? Suppose you have a 20 GB hard disk, and 4 primary partitions have used up 15 GB. You think there is still 5 GB available, right? Wrong! The remaining 5 GB cannot be used at all because there are no more partition table record areas to record, so additional partitioning cannot be carried out, and of course the space is wasted. Therefore, please pay special attention. If you want to partition more than 4 slots, please remember that there must be an Extended partition area, and all remaining space must be allocated to Extended, and then the space of Extended is planned with Logical partitions.
Thought 2: Can I only partition 1 Primary and 1 Extended?
Of course you can! Basically, there can be 64 Logical partitions. Therefore, you can only partition one primary partition, and allocate all other partitions to Extended, and use Logical partitions to plan other partitions!
Thought 3: Suppose my hard disk is installed on IDE 1's Master, and I want to partition into 6 usable hard disk sectors, then what are the codes of each disk under Linux?
Explanation:
Since the Primary + Extended of the hard disk can have at most four, under Linux, partition numbers 1 to 4 have been reserved first. If only 2 P + E are used, then two partition numbers will be vacant! To explain in more detail, suppose I have used up all four P + E. Among them, the Extended /dev/hda4 includes three logical partitions.
The actually usable ones are /dev/hda1, /dev/hda2, /dev/hda3, /dev/hda5, /dev/hda6, /dev/hda7 these six partitions! As for the Extended sector /dev/hda4 itself, it is only used to plan the disk space available for Logical.
Then what if I only want to partition 1 Primary and 1 Extended?
Because numbers 1 to 4 have been reserved, the code of the first Logical starts from number 5, and the ones planned later are increased in a cumulative way. Among them, /dev/hda3 and /dev/hda4 are empty and reserved codes.
This problem will be more accurately explained in combination with history. Why can there be at most four main partitions, which is not only determined by the operating system.
First, why is a sector only 512 bytes, why not 1024 bytes?
First of all, I want to say that the size of a sector can be defined by itself (by the hard disk manufacturer), and it can be 1024 bytes. So the fact that a sector is 512 bytes is not a theoretical value, but a habitual value. That is to say, the size of a sector being 512 bytes has been habitually defined by hard disk manufacturers, and no one wants to change this habit.
Second, the first sector of the hard disk can be divided into three parts: the first part is MBR, which needs to occupy 446 bytes, and the second part is DPT, which needs to occupy 64 bytes. This is because one partition table needs to occupy 16 bytes, 64/16 = 4, so it can just store the tables of four partitions. This is why there can be only four partitions. The remaining two bytes are used to store the end mark. So
446 + 64 + 2 = 512 bytes.
In fact, encrypting the hard disk is to rewrite the last two bytes of the end mark.
Imagine if the hard disk manufacturer had set a sector to 1024 bytes at the beginning, would there still be only four partitions? Logical drives also need partition tables, which are stored in the first sector of the extended partition, so logical drives are not arbitrarily divided as many as you want.
淘宝网址:http://shop62365712.taobao/
客服QQ:859230308,859096898
客服QQ:859230308,859096898
