Home >System Tutorial >LINUX >An in-depth analysis of CentOS disk and partition naming conventions

An in-depth analysis of CentOS disk and partition naming conventions

WBOY
WBOYforward
2023-12-30 16:54:00702browse

In Linux, there is no concept of drive letter. Devices are accessed through device names, which are stored in the /dev directory.

The SSD, SAS, and SATA hard disks mentioned earlier are all hard disks of the SCSI interface type, and are identified by sd in Linux, while IDE hard disks are hard disks of the IDE interface type, and are identified by hd in Linux.

In Linux, the naming rules for different hard disks are as follows:

The first SCSI interface type hard disk: /dev/sda

The second SCSI interface type hard disk: /dev/sdb

The first IDE interface type hard disk: /dev/hda

The second IDE interface type hard disk: /dev/hdb

Regarding hard disk partitions, a hard disk can only have up to 4 primary partitions or 3 primary partitions plus 1 extended partition. That is, serial numbers 1-4 are reserved for primary partitions or extended partitions. Primary partitions and extended partitions There are only 4 in total, and the primary partition and the extended partition are on the same level. A hard disk can only have one extended partition at most, but the extended partition cannot be used directly to store data. It needs to be divided into several logical partitions. Therefore, it can be seen from the above that the number of the logical partition must start from 5.

Partition scheme in Linux:

3p 1e or 2p 1e or 1p 1e

Partition number in Linux:

The first partition of the first SCSI interface type hard disk: /dev/sda1

The fifth partition of the first SCSI interface type hard disk: /dev/sda5

The first partition of the first IDE interface type hard disk: /dev/hda1

The fifth partition of the first IDE interface type hard disk: /dev/hda5

The above is the detailed content of An in-depth analysis of CentOS disk and partition naming conventions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete