In VMware virtual machine (Linux), our Linux server may have multiple disks (or virtual disks), as shown below. The disks of this server include hard disk 1, hard disk 2 The hard disk 10 has a total of 10 hard disks.
In Linux system, the corresponding devices in the disk are as follows
[root@mylnx01 ~]# ls -lrt /dev/sd*
brw-r----- 1 root disk 8, 0 Apr 30 09:53 /dev/sdabrw-r----- 1 root disk 8, 3 Apr 30 09:53 /dev/sda3brw-r----- 1 root disk 8, 2 Apr 30 09:53 /dev/sda2brw-r----- 1 root disk 8, 21 Apr 30 09:53 /dev/sdb5brw-r----- 1 root disk 8, 18 Apr 30 09:53 /dev/sdb2brw-r----- 1 root disk 8, 17 Apr 30 09:53 /dev/sdb1brw-r----- 1 root disk 8, 16 Apr 30 09:53 /dev/sdbbrw-r----- 1 root disk 8, 37 Apr 30 09:53 /dev/sdc5brw-r----- 1 root disk 8, 34 Apr 30 09:53 /dev/sdc2brw-r----- 1 root disk 8, 33 Apr 30 09:53 /dev/sdc1brw-r----- 1 root disk 8, 32 Apr 30 09:53 /dev/sdcbrw-r----- 1 root disk 8, 64 Apr 30 09:53 /dev/sdebrw-r----- 1 root disk 8, 49 Apr 30 09:53 /dev/sdd1brw-r----- 1 root disk 8, 48 Apr 30 09:53 /dev/sddbrw-r----- 1 root disk 8, 82 Apr 30 09:53 /dev/sdf2brw-r----- 1 root disk 8, 81 Apr 30 09:53 /dev/sdf1brw-r----- 1 root disk 8, 80 Apr 30 09:53 /dev/sdfbrw-r----- 1 root disk 8, 69 Apr 30 09:53 /dev/sde5brw-r----- 1 root disk 8, 65 Apr 30 09:53 /dev/sde1brw-r----- 1 root disk 8, 113 Apr 30 09:53 /dev/sdh1brw-r----- 1 root disk 8, 112 Apr 30 09:53 /dev/sdhbrw-r----- 1 root disk 8, 96 Apr 30 09:53 /dev/sdgbrw-r----- 1 root disk 8, 85 Apr 30 09:53 /dev/sdf5brw-r----- 1 root disk 8, 129 Apr 30 09:53 /dev/sdi1brw-r----- 1 root disk 8, 128 Apr 30 09:53 /dev/sdibrw-r----- 1 root disk 8, 101 Apr 30 09:53 /dev/sdg5brw-r----- 1 root disk 8, 97 Apr 30 09:53 /dev/sdg1brw-r----- 1 root disk 8, 130 Apr 30 09:53 /dev/sdi2brw-r----- 1 root disk 8, 147 Apr 30 09:53 /dev/sdj3brw-r----- 1 root disk 8, 146 Apr 30 09:53 /dev/sdj2brw-r----- 1 root disk 8, 145 Apr 30 09:53 /dev/sdj1brw-r----- 1 root disk 8, 144 Apr 30 09:53 /dev/sdjbrw-r----- 1 root disk 8, 152 Apr 30 09:53 /dev/sdj8brw-r----- 1 root disk 8, 151 Apr 30 09:53 /dev/sdj7brw-r----- 1 root disk 8, 150 Apr 30 09:53 /dev/sdj6brw-r----- 1 root disk 8, 149 Apr 30 09:53 /dev/sdj5brw-r----- 1 root disk 8, 148 Apr 30 09:53 /dev/sdj4brw-r----- 1 root disk 8, 153 Apr 30 09:53 /dev/sdj9brw-r----- 1 root disk 8, 1 Apr 30 09:53 /dev/sda1
So how do we find out which disk / dev/sdj corresponds to in VMware? I believe that many students may want to judge by disk size, but this is not easy to judge or accurate by disk size, mainly due to the following factors:
1: The disk size is calculated differently on both sides. The disk size you see is a little different.
2: There may be disks of the same size. How do you judge at this time?
Is there a sign to judge it? According to the SCSI standard, each SCSI disk has a WWID, which is similar to the MAC address of the network card, and is unique. The / dev / disk / by ID directory on a Linux system contains the WWID access path for each SCSI disk.
[root@KerryDB ~]# ll /dev/disk/by-id/
total 0lrwxrwxrwx. 1 root root 9 Apr 11 09:25 ata-ST500DM002-1BD142_Z6EA17FP -> ../../sdalrwxrwxrwx. 1 root root 10 Apr 11 09:25 ata-ST500DM002-1BD142_Z6EA17FP-part1 -> ../../sda1lrwxrwxrwx. 1 root root 10 Apr 11 09:25 ata-ST500DM002-1BD142_Z6EA17FP-part2 -> ../../sda2lrwxrwxrwx. 1 root root 10 Apr 11 09:25 ata-ST500DM002-1BD142_Z6EA17FP-part3 -> ../../sda3lrwxrwxrwx. 1 root root 10 Mar 10 14:29 dm-name-centos-home -> ../../dm-2lrwxrwxrwx. 1 root root 10 Mar 10 14:29 dm-name-centos-root -> ../../dm-0lrwxrwxrwx. 1 root root 10 Mar 10 14:29 dm-name-centos-swap -> ../../dm-1lrwxrwxrwx. 1 root root 10 Mar 10 14:29 dm-uuid-LVM-OoLL2Ne7hVrlu1rWFZRicmPrEZGxlZhQ2GwVhfhZrdLWmRZ3KuKGNJJqskLn2noy -> ../../dm-0lrwxrwxrwx. 1 root root 10 Mar 10 14:29 dm-uuid-LVM-OoLL2Ne7hVrlu1rWFZRicmPrEZGxlZhQNALIUTdrhqV42RQNW8jaImopDuEPs5b3 -> ../../dm-1lrwxrwxrwx. 1 root root 10 Mar 10 14:29 dm-uuid-LVM-OoLL2Ne7hVrlu1rWFZRicmPrEZGxlZhQybFeXSOtclTjcV0dS9tKiwA1IVBwxnrK -> ../../dm-2lrwxrwxrwx. 1 root root 10 Apr 11 09:25 lvm-pv-uuid-FAYN5y-YdiR-CywU-1vDf-Btz6-dkyt-TNy8ee -> ../../sda3lrwxrwxrwx. 1 root root 9 Apr 11 09:25 wwn-0x5000c5007911cd0c -> ../../sdalrwxrwxrwx. 1 root root 10 Apr 11 09:25 wwn-0x5000c5007911cd0c-part1 -> ../../sda1lrwxrwxrwx. 1 root root 10 Apr 11 09:25 wwn-0x5000c5007911cd0c-part2 -> ../../sda2lrwxrwxrwx. 1 root root 10 Apr 11 09:25 wwn-0x5000c5007911cd0c-part3 -> ../../sda3
But in the current environment, VMware virtual machine (Linux) does not turn on this option by default.
# ll /dev/disk/by-id
ls: /dev/disk/by-id: No such file or directory# cd /dev/disk
# ls -lrt
total 0drwxr-xr-x 2 root root 60 May 3 19:35 by-uuiddrwxr-xr-x 2 root root 60 May 3 19:35 by-labeldrwxr-xr-x 2 root root 640 May 3 19:35 by-path
Moreover, if you connect VMware vSphere Client to VMware console, you will find that there is no WWID information of the hard disk. Even if you find the WWID information of the device in Linux, you can't see the corresponding WWID information in VMware console. We can also judge it by the SCSI number of the computer It can be applied to many devices (including random access devices, such as disks and sequential storage devices such as tape). As shown in the screenshot below, disks are managed by SCSI controller, and hard disk 9 corresponds to SCSI (0:11)
[root@mylnx01 ~]# ll /dev/disk/by-path | grep '0:11'
lrwxrwxrwx 1 root root 9 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0 -> ../../sdjlrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part1 -> ../../sdj1lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part2 -> ../../sdj2lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part3 -> ../../sdj3lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part4 -> ../../sdj4lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part5 -> ../../sdj5lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part6 -> ../../sdj6lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part7 -> ../../sdj7lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part8 -> ../../sdj8lrwxrwxrwx 1 root root 10 Apr 30 09:53 pci-0000:00:10.0-scsi-0:0:11:0-part9 -> ../../sdj9[root@mylnx01 ~]# ls -l /dev/sdj*
brw-r----- 1 root disk 8, 144 Apr 30 09:53 /dev/sdjbrw-r----- 1 root disk 8, 145 Apr 30 09:53 /dev/sdj1brw-r----- 1 root disk 8, 146 Apr 30 09:53 /dev/sdj2brw-r----- 1 root disk 8, 147 Apr 30 09:53 /dev/sdj3brw-r----- 1 root disk 8, 148 Apr 30 09:53 /dev/sdj4brw-r----- 1 root disk 8, 149 Apr 30 09:53 /dev/sdj5brw-r----- 1 root disk 8, 150 Apr 30 09:53 /dev/sdj6brw-r----- 1 root disk 8, 151 Apr 30 09:53 /dev/sdj7brw-r----- 1 root disk 8, 152 Apr 30 09:53 /dev/sdj8brw-r----- 1 root disk 8, 153 Apr 30 09:53 /dev/sdj9
As shown above, we can judge that disk 9 corresponds to / dev/sdj under Linux through the output information of the above command.