The following describes the two Representation Methods of the storage device in Linux. It is okay to send it out. I hope it will be helpful to some users who do not understand it. You can skip this step. The following describes two methods for expressing storage devices in Linux.
2) The second representation of Hard Disk Partitions (hd [0-n], y );
We have already mentioned that the entire hard disk has two Representation Methods:/dev/hd [a-z] and hd [0-n].
For a hard disk partition, you must first confirm the hard disk where it is located, and then confirm its location. To make a metaphor, for example, if I live in room YYY of XXX Hotel, I only want to tell others that I am not enough at XXX hotel, and I want to tell them room YYY so that people who come to me can find me. So we need to know a hard disk partition, in addition to knowing the location of/dev/hd [a-z], you also need to know where it is, that is, the previous/dev/hd [a-z] X statement, after confirming that the partition is in/dev/hd [a-z], use X to confirm the specific location;
This topic describes another representation (hd [0-n], y) and hd [0-n]. We know this is one of the hard disk Representation Methods. If you do not understand this, let's take a look at the previous things. What does y mean here? The value of y is the X-1 in/dev/hd [a-z] X;
Use an instance to understand it;
- [root@localhost ~]# fdisk -l
-
- Disk /dev/hda: 80.0 GB, 80026361856 bytes
- 255 heads, 63 sectors/track, 9729 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
-
- Device Boot Start End Blocks Id System
- /dev/hda1 * 1 970 7791493+ 7 HPFS/NTFS
- /dev/hda2 971 9729 70356667+ 5 Extended
- /dev/hda5 971 2915 15623181 b W95 FAT32
- /dev/hda6 2916 4131 9767488+ 83 Linux
- /dev/hda7 4132 5590 11719386 83 Linux
- /dev/hda8 5591 6806 9767488+ 83 Linux
- /dev/hda9 6807 9657 22900626 83 Linux
- /dev/hda10 9658 9729 578308+ 82 Linux swap / Solaris
/Dev/hda1 equals (hd0, 0)
/Dev/hda2 is equivalent to (hd0, 1) Note: Well, this is an extended partition. It cannot be mounted in Linux or Windows;
/Dev/hda5 equals (hd0, 4)
/Dev/hda6 equals (hd0, 5)
/Dev/hda7 equivalent (hd0, 6)
/Dev/hda8 equals (hd0, 7)
......
/Dev/hda10 (hd0, 9)
If there is only one hard disk on the machine, no matter whether it is in Linux Through/dev/hda or/dev/hdb, hd0 is represented by hd [0-N; therefore, if the hard disk is listed;
- [root@localhost ~]# fdisk -l
-
- Disk /dev/hdb: 80.0 GB, 80026361856 bytes
- 255 heads, 63 sectors/track, 9729 cylinders
- Units = cylinders of 16065 * 512 = 8225280 bytes
-
- Device Boot Start End Blocks Id System
- /dev/hdb1 * 1 970 7791493+ 7 HPFS/NTFS
- /dev/hdb2 971 9729 70356667+ 5 Extended
- /dev/hdb5 971 2915 15623181 b W95 FAT32
- /dev/hdb6 2916 4131 9767488+ 83 Linux
- /dev/hdb7 4132 5590 11719386 83 Linux
- /dev/hdb8 5591 6806 9767488+ 83 Linux
- /dev/hdb9 6807 9657 22900626 83 Linux
- /dev/hdb10 9658 9729 578308+ 82 Linux swap / Solaris
There is only one hard disk on the machine.If the/dev/hdb Partition Table is listed through fdisk-l, the correspondence is the same as that of the partition table listed in/dev/hda;
/Dev/hdb1 equals (hd0, 0)
/Dev/hdb2 equivalent (hd0, 1) Note: As you can see, this is an extended partition, which cannot be mounted in Linux or Windows;
/Dev/hdb5 equivalent (hd0, 4)
/Dev/hdb6 equals (hd0, 5)
/Dev/hdb7 equivalent (hd0, 6)
/Dev/hdb8 equivalent (hd0, 7)
......
/Dev/hdb10 equivalent (hd0, 9)
Note: if there are two hard disks on the machine, the other representation of/dev/hda is hd0, and another representation of/dev/hdb is hd1; in this way, we can understand (hd [0-N], y). In this way, machines only have one or more hard disks, and we all know how to write them. Right? Maybe not. correct it;
Click "Two Representation Methods of storage devices in Linux" below.