Linux naming method for hard disks and partitions in detail

  
                  Under Linux, the IDE device is named after hd. Generally, there are two IDE interfaces on the motherboard, and a total of four IDE devices can be installed. The master and slave devices on the primary IDE are hda and hdb respectively, and the two devices on the second IDE port are hdc and hdd. The general hard disk is installed on the main interface of the main IDE, so it is hda.

The SCSI interface device is named after sd, the first device is sda and the second is sdb. So on and so forth .

Partitions are named with the device name plus a number. To fully understand the rules for Linux hard disk partition names, you must first understand the concepts of primary partitions, extended partitions, logical partitions, and their relationships. A hard disk can be divided into up to 4 primary partitions; therefore, the hard disk can be divided into 1-3 primary partitions plus one extended partition, or only 1-4 primary partitions. For an extended partition, you can continue to divide it into several logical partitions, which means that the extended partition is just a "container" of the logical partition. The names of the primary partitions are hda1, hda2, hda3, and hda4, respectively, where the extended partition also occupies the name of one primary partition. The name of the logical partition must start from hda5. For each additional partition, the number of the partition name is incremented by 1, such as hda6 for the second logical partition and so on.

The hard disk of the SCSI interface is similar.

To understand the name of the D, E, F partition under Windows on your hard disk, you must first understand how your hard disk is partitioned. Is the primary partition or logical partition, is the first primary partition (logical partition).

The reason why only 4 primary partitions can be allocated: MBR (Master Boot Record) only has space for storing 4 partition information (64 bytes).

MBR (Master Boot Record), the master boot record, located in the 0 sector 0 cylinder 1 sector of the entire hard disk. However, in a total of 512 bytes of the main boot sector, the MBR only occupies 446 of them (offset 0 - offset 1BDH), and the other 64 bytes (offset 1BEH - offset 1FDH) ) is handed to the DPT (Disk Partition Table), the last two bytes "55, AA" (offset 1FEH - offset 1FFH) is the end of the partition. This whole constitutes the main boot sector of the hard disk. The approximate structure is shown in the figure.


Copyright © Windows knowledge All Rights Reserved