You find that the device name displayed in the ECS OS is different from that displayed on the management console and you cannot determine which disk name is correct. This section describes how to obtain the disk name used in an ECS OS according to the device identifier on the console.
For details about how to attach disks, see Attach an EVS Disk.
If Device Identifier is not displayed on the page, stop the ECS and restart it.
If you use a serial number (recommended) to obtain the disk name, see Using a Serial Number to Obtain the Disk Name (Windows) and Using a Serial Number to Obtain a Disk Device Name (Linux).
If you use a BDF to obtain the disk device name, see Using a BDF to Obtain a Disk Device Name (Linux). (BDF cannot be used to obtain the disk name of Windows ECSs.)
If a serial number is displayed on the console, use either of the following methods to obtain the disk name.
cmd
wmic diskdrive get serialnumber
wmic path win32_physicalmedia get SerialNumber
wmic path Win32_DiskDrive get SerialNumber
A serial number is the first 20 digits of a disk UUID.
For example, if the serial number of a VBD disk on the console is 97c876c0-54b3-460a-b, run either of the following commands to obtain the serial number of the disk on the ECS OS:
wmic diskdrive get serialnumber
wmic path win32_physicalmedia get SerialNumber
wmic path Win32_DiskDrive get SerialNumber
Information similar to the following is displayed:
wmic diskdrive get Name, SerialNumber
PowerShell
Get-CimInstance -ClassName Win32_LogicalDiskToPartition |select Antecedent, Dependent |fl
As shown in Figure 3, the disk is Disk 0.
Get-Disk |select Number, SerialNumber
As shown in Figure 3, the disk is Disk 0.
Get-WmiObject -Class Win32_PhysicalMedia |select Tag, Serialnumber
Get-WmiObject -Class Win32_LogicalDiskToPartition |select Antecedent, Dependent |fl
If a serial number is displayed on the console, run either of the following commands to obtain the device name.
# udevadm info --query=all --name=/dev/xxx | grep ID_SERIAL
# ll /dev/disk/by-id/*
A serial number is the first 20 digits of a disk UUID.
For example, if the serial number of the VBD disk is 62f0d06b-808d-480d-8, run either of the following commands:
# udevadm info --query=all --name=/dev/vdb | grep ID_SERIAL
# ll /dev/disk/by-id/*
The following information is displayed:
[root@ecs-ab63 ~]# udevadm info --query=all --name=/dev/vdb | grep ID_SERIAL E: ID_SERIAL=62f0d06b-808d-480d-8 [root@ecs-ab63 ~]# ll /dev/disk/by-id/* lrwxrwxrwx 1 root root 9 Dec 30 15:56 /dev/disk/by-id/virtio-128d5bfd-f215-487f-9 -> ../../vda lrwxrwxrwx 1 root root 10 Dec 30 15:56 /dev/disk/by-id/virtio-128d5bfd-f215-487f-9-part1 -> ../../vda1 lrwxrwxrwx 1 root root 9 Dec 30 15:56 /dev/disk/by-id/virtio-62f0d06b-808d-480d-8 -> ../../vdb
/dev/vdb is the disk device name.
ll /sys/bus/pci/devices/BDF disk ID/virtio*/block
For example, if the BDF disk ID of the VBD disk is 0000:02:02.0, run the following command to obtain the device name:
ll /sys/bus/pci/devices/0000:02:02.0/virtio*/block
The following information is displayed:
[root@ecs-ab63 ~]# ll /sys/bus/pci/devices/0000:02:02.0/virtio*/block total 0 drwxr-xr-x 8 root root 0 Dec 30 15:56 vdb
/dev/vdb is the disk device name.
For example, the obtained WWN (device identifier) is 688860300003252ffa16520d39517815.
Get-CimInstance Win32_DiskDrive | Select-Object DeviceID, SerialNumber
ll /dev/disk/by-id |grep WWN|grep scsi-3
For example, if the WWN obtained on the console is 6888603000008b32fa16688d09368506, run the following command:
ll /dev/disk/by-id |grep 6888603000008b32fa16688d09368506|grep scsi-3
The following information is displayed:
[root@host-192-168-133-148 block]# ll /dev/disk/by-id/ |grep 6888603000008b32fa16688d09368506 |grep scsi-3 lrwxrwxrwx 1 root root 9 May 21 20:22 scsi-36888603000008b32fa16688d09368506 -> ../../sda