Two Representation Methods for storing devices in Linux (2)

Source: Internet
Author: User

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;

 
 
  1. [root@localhost ~]# fdisk -l  
  2.  
  3. Disk /dev/hda: 80.0 GB, 80026361856 bytes  
  4. 255 heads, 63 sectors/track, 9729 cylinders  
  5. Units = cylinders of 16065 * 512 = 8225280 bytes  
  6.  
  7. Device Boot      Start         End      Blocks   Id  System  
  8. /dev/hda1   *           1         970     7791493+   7  HPFS/NTFS  
  9. /dev/hda2             971        9729    70356667+   5  Extended  
  10. /dev/hda5             971        2915    15623181    b  W95 FAT32  
  11. /dev/hda6            2916        4131     9767488+  83  Linux  
  12. /dev/hda7            4132        5590    11719386   83  Linux  
  13. /dev/hda8            5591        6806     9767488+  83  Linux  
  14. /dev/hda9            6807        9657    22900626   83  Linux  
  15. /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;

 
 
  1.  [root@localhost ~]# fdisk -l  
  2.  
  3. Disk /dev/hdb: 80.0 GB, 80026361856 bytes  
  4. 255 heads, 63 sectors/track, 9729 cylinders  
  5. Units = cylinders of 16065 * 512 = 8225280 bytes  
  6.  
  7. Device Boot      Start         End      Blocks   Id  System  
  8. /dev/hdb1   *           1         970     7791493+   7  HPFS/NTFS  
  9. /dev/hdb2             971        9729    70356667+   5  Extended  
  10. /dev/hdb5             971        2915    15623181    b  W95 FAT32  
  11. /dev/hdb6            2916        4131     9767488+  83  Linux  
  12. /dev/hdb7            4132        5590    11719386   83  Linux  
  13. /dev/hdb8            5591        6806     9767488+  83  Linux  
  14. /dev/hdb9            6807        9657    22900626   83  Linux  
  15. /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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.