在 Ubuntu 16.04 中,我安装了 multipath-tools 软件包来启用多路径。登录 iSCSI 设备后,我使用命令“multipath -ll”获取 mpath 设备名称,然后在目录“/dev/mapper”中查询。它显示在目录“/dev/mapper”中不存在该设备。
最后发现,“dev/mapper”中的设备名和“multipath -l”命令输出中显示的设备名不一致。
这是 Ubuntu16.04 的问题吗?我在 Ubuntu14.04 上试过了,它们是一致的。
这是我使用的环境
stack@ubuntu:~$ uname -a Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux stack@ubuntu:~$ sudo dpkg -l |grep multipath-tools ii multipath-tools 0.5.0+git1.656f8865-5ubuntu2.1 amd64 maintain multipath block device access stack@ubuntu:~$ stack@ubuntu:~$ ll /dev/mapper/ total 0 drwxr-xr-x 2 root root 80 Jul 26 17:09 ./ drwxr-xr-x 18 root root 4560 Jul 26 17:09 ../ brw-rw---- 1 root disk 252, 0 Jul 26 17:09 36006016013003e00c56c0ff5a353e611 crw------- 1 root root 10, 236 Jul 25 23:46 control stack@ubuntu:~$ sudo multipath -ll 36006016013003e00a90c8cc0a553e611 dm-0 DGC,VRAID size=1.0G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw |-+- policy='round-robin 0' prio=50 status=active | |- 12:0:0:229 sde 8:64 active ready running | `- 13:0:0:229 sdg 8:96 active ready running `-+- policy='round-robin 0' prio=10 status=enabled |- 11:0:0:229 sdc 8:32 active ready running `- 14:0:0:229 sdi 8:128 active ready running stack@ubuntu:~$ ll /dev/disk/by-path/ total 0 drwxr-xr-x 2 root root 300 Jul 26 17:09 ./ drwxr-xr-x 6 root root 120 Jul 26 17:09 ../ lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.3.52:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.b5-lun-0 -> ../../sdh lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.3.52:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.b5-lun-229 -> ../../sdi lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.3.53:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.a5-lun-0 -> ../../sdf lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.3.53:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.a5-lun-229 -> ../../sdg lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.4.52:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.a4-lun-0 -> ../../sdd lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.4.52:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.a4-lun-229 -> ../../sde lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.4.53:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.b4-lun-0 -> ../../sdb lrwxrwxrwx 1 root root 9 Jul 26 17:09 ip-192.168.4.53:3260-iscsi-iqn.1992-04.com.emc:cx.apm00153906536.b4-lun-229 -> ../../sdc lrwxrwxrwx 1 root root 9 Jul 25 23:46 pci-0000:00:07.1-ata-2 -> ../../sr0 lrwxrwxrwx 1 root root 9 Jul 25 23:46 pci-0000:00:10.0-scsi-0:0:0:0 -> ../../sda lrwxrwxrwx 1 root root 10 Jul 25 23:46 pci-0000:00:10.0-scsi-0:0:0:0-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Jul 25 23:46 pci-0000:00:10.0-scsi-0:0:0:0-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Jul 25 23:46 pci-0000:00:10.0-scsi-0:0:0:0-part5 -> ../../sda5 stack@ubuntu:~$ sudo udevadm info /dev/mapper/36006016013003e00c56c0ff5a353e611 P: /devices/virtual/block/dm-0 N: dm-0 L: 50 S: disk/by-id/dm-name-36006016013003e00a90c8cc0a553e611 S: disk/by-id/dm-uuid-mpath-36006016013003e00a90c8cc0a553e611 S: disk/by-id/scsi-36006016013003e00a90c8cc0a553e611 S: disk/by-id/wwn-0x6006016013003e00a90c8cc0a553e611 S: disk/by-label/cirros-rootfs S: disk/by-uuid/d42bb4a4-04bb-49b0-8821-5b813116b17b E: DEVLINKS=/dev/disk/by-id/dm-uuid-mpath-36006016013003e00a90c8cc0a553e611 /dev/disk/by-uuid/d42bb4a4-04bb-49b0-8821-5b813116b17b /dev/disk/by-id/dm-name-36006016013003e00a90c8cc0a553e611 /dev/disk/by-label/cirros-rootfs /dev/disk/by-id/wwn-0x6006016013003e00a90c8cc0a553e611 /dev/disk/by-id/scsi-36006016013003e00a90c8cc0a553e611 E: DEVNAME=/dev/dm-0 E: DEVPATH=/devices/virtual/block/dm-0 E: DEVTYPE=disk E: DM_ACTIVATION=1 E: DM_NAME=36006016013003e00a90c8cc0a553e611 E: DM_STATE=ACTIVE E: DM_SUSPENDED=0 E: DM_TABLE_STATE=LIVE E: DM_TYPE=scsi E: DM_UDEV_DISABLE_DM_RULES_FLAG=1 E: DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG=1 E: DM_UDEV_PRIMARY_SOURCE_FLAG=1 E: DM_UDEV_RULES=1 E: DM_UUID=mpath-36006016013003e00a90c8cc0a553e611 E: DM_WWN=0x6006016013003e00a90c8cc0a553e611 E: ID_FS_LABEL=cirros-rootfs E: ID_FS_LABEL_ENC=cirros-rootfs E: ID_FS_TYPE=ext3 E: ID_FS_USAGE=filesystem E: ID_FS_UUID=d42bb4a4-04bb-49b0-8821-5b813116b17b E: ID_FS_UUID_ENC=d42bb4a4-04bb-49b0-8821-5b813116b17b E: ID_FS_VERSION=1.0 E: MAJOR=252 E: MINOR=0 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=62597391570 stack@ubuntu:~$