List devices slots, virtual and physical with position into the server:
samba:~ # lsslot Getting node types 0x00000007 DR nodes list ============== /proc/device-tree/vdevice: drc index: 0x30000009 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C9 loc code: /proc/device-tree/vdevice: drc index: 0x30000008 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C8 loc code: /proc/device-tree/vdevice: drc index: 0x30000007 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C7 loc code: /proc/device-tree/vdevice: drc index: 0x30000006 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C6 loc code: /proc/device-tree/vdevice: drc index: 0x30000005 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C5 loc code: /proc/device-tree/vdevice: drc index: 0x30000004 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C4 loc code: /proc/device-tree/vdevice/v-scsi@30000003: drc index: 0x30000003 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C3 loc code: /proc/device-tree/vdevice/l-lan@30000002: drc index: 0x30000002 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C2 loc code: /proc/device-tree/vdevice: drc index: 0x30000001 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C1 loc code: /proc/device-tree/vdevice/vty@30000000: drc index: 0x30000000 description: Virtual I/O Slot drc name: U7895.22X.069581B-V7-C0 loc code: # Slot Description Linux Name Device(s) U7895.22X.069581B-V7-C0 Virtual I/O Slot 30000000 vty U7895.22X.069581B-V7-C2 Virtual I/O Slot 30000002 l-lan U7895.22X.069581B-V7-C3 Virtual I/O Slot 30000003 v-scsi
List SCSI devices:
samba:~ # lsscsi [0:0:1:0] disk AIX VDASD 0001 /dev/sda [0:0:2:0] disk AIX VDASD 0001 /dev/sdb [0:0:3:0] disk AIX VDASD 0001 /dev/sdc [0:0:4:0] disk AIX VDASD 0001 /dev/sdd [0:0:5:0] disk AIX VDASD 0001 /dev/sde
List multipath devices:
samba:~ # multipath -ll 360080e500018110000000a95524cd2a5 dm-11 AIX ,VDASD size=250G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 0:0:3:0 sdc 8:32 active ready running 360080e500017e43c00000fbb524cc110 dm-12 AIX ,VDASD size=250G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 0:0:4:0 sdd 8:48 active ready running 360080e500017e43c00000fb8524cc0e3 dm-10 AIX ,VDASD size=250G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 0:0:2:0 sdb 8:16 active ready running 360080e500018110000000a97524cd2db dm-13 AIX ,VDASD size=250G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 0:0:5:0 sde 8:64 active ready running
yum install sysfsutils
# cat /sys/class/fc_host/host*/port_name
Install sg3_utils and lsscsi package.
[root@fedora01 ~]# /usr/bin/rescan-scsi-bus.sh -l Host adapter 0 (mptspi) found. Scanning SCSI subsystem for new devices Scanning host 0 for SCSI target IDs 0 1 2 3 4 5 6 7, LUNs 0 1 2 3 4 5 6 7
[root@fedora01 ~]# lsscsi [0:0:0:0] disk VMware Virtual disk 1.0 /dev/sda [0:0:1:0] disk VMware Virtual disk 1.0 /dev/sdb
If rescan not working (for all linux and also Ubuntu) try:
[root@ubuntu ~]# ls /sys/class/scsi_host/host*/scan [root@ubuntu ~]# echo "- - -" > /sys/class/scsi_host/host0/scan [root@ubuntu ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
for i in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > $i; done
You can get the Fiber Channel addresses of the HBAs by typing the following commands:
# systool -c fc_host -v
Type the following command to determine the fibre channel target WWN:
# systool -c fc_transport -v
You will get node name (FC WWN) and port name of the storage processor port. Type the following command, to determine the mapping between SCSI HBTL addresses and the disks:
# sg_map -x
[root@fedora22 multipath]# dmsetup ls fedora-swap (253:0) fedora-root (253:1)
[root@fedora22 multipath]# lsscsi [0:0:1:0] disk AIX VDASD 0001 /dev/sda [0:0:2:0] cd/dvd AIX VOPTA /dev/sr0
[root@fedora22 multipath]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 50G 0 disk ├─sda1 8:1 0 4M 0 part ├─sda2 8:2 0 500M 0 part /boot └─sda3 8:3 0 49.5G 0 part ├─fedora-swap 253:0 0 2G 0 lvm [SWAP] └─fedora-root 253:1 0 47.5G 0 lvm / sr0 11:0 1 1024M 0 rom
If you want to remove a device for example a disk /dev/mapper/mapthb, remove his multipath device using:
[root@fedora22 multipath]# dmsetup remove mpathb
Configure
[root@gpfs01 ~]# multipath -t > /etc/multipath.conf [root@gpfs01 ~]# systemctl enable multipathd.service [root@gpfs01 ~]# systemctl start multipathd.service
Rescan
[root@gpfs01 ~]# for i in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > $i; done [root@gpfs01 ~]# lsscsi [0:2:0:0] disk IBM ServeRAID M1115 2.13 /dev/sda [0:2:1:0] disk IBM ServeRAID M1115 2.13 /dev/sdb [1:0:0:0] cd/dvd IMM Virtual Media 0325 /dev/sr1 [2:0:0:0] cd/dvd IBM SATA DEVICE 81Y3676 IBD1 /dev/sr0 [8:0:0:0] disk IBM 2145 0000 /dev/sdc [8:0:1:0] disk IBM 2145 0000 /dev/sdd [9:0:2:0] disk IBM 2145 0000 /dev/sde [9:0:3:0] disk IBM 2145 0000 /dev/sdf [root@gpfs01 ~]# multipath -ll mpatha (36005076300810163a000000000000057) dm-5 IBM ,2145 size=8.0G features='1 queue_if_no_path' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=50 status=active | |- 9:0:3:0 sdf 8:80 active ready running | `- 8:0:1:0 sdd 8:48 active ready running `-+- policy='service-time 0' prio=10 status=enabled |- 8:0:0:0 sdc 8:32 active ready running `- 9:0:2:0 sde 8:64 active ready running
[root@lnxa087 scripts]# /usr/sbin/multipath -ll mpatha (36005076801818664680000000000062d) dm-0 IBM ,2145 size=40G features='1 queue_if_no_path' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=0 status=enabled | |- 1:0:2:0 sdb 8:16 failed faulty offline | |- 2:0:2:0 sdh 8:112 failed faulty offline | |- 3:0:2:0 sde 8:64 failed faulty offline | `- 4:0:2:0 sdg 8:96 failed faulty offline `-+- policy='service-time 0' prio=10 status=active |- 1:0:0:0 sda 8:0 active ready running |- 2:0:0:0 sdc 8:32 active ready running |- 3:0:0:0 sdd 8:48 active ready running `- 4:0:0:0 sdf 8:80 active ready running [root@lnxa087 scripts]# pvs /dev/sdb: open failed: No such device or address /dev/sde: open failed: No such device or address /dev/sdg: open failed: No such device or address /dev/sdh: open failed: No such device or address PV VG Fmt Attr PSize PFree /dev/mapper/mpatha3 centos lvm2 a-- 38.99g 0
First try to rescan:
[root@lnxa087 scripts]# for i in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > $i; done
If not success, check adapter status (required sysfsutils package)
[root@lnxa087 etc]# systool -c fc_host -v Class = "fc_host" Class Device = "host1" Class Device path = "/sys/devices/vio/30000004/host1/fc_host/host1" dev_loss_tmo = "300" fabric_name = "0xc0507608249e00ac" issue_lip = <store method only> maxframe_size = "2048 bytes" node_name = "0xc0507608249e00ac" port_id = "0xbf1b13" port_name = "0xc0507608249e00ac" port_state = "Online" port_type = "NPIV VPORT" speed = "8 Gbit" supported_classes = "Class 2, Class 3" tgtid_bind_type = "wwpn (World Wide Port Name)" uevent = Device = "host1" Device path = "/sys/devices/vio/30000004/host1" uevent = "DEVTYPE=scsi_host" ...
If adapters OK, the remove failed paths:
[root@lnxa087 etc]# rescan-scsi-bus.sh -r
Rescan
[root@lnxa087 etc]# sg_map -x /dev/sg1 1 0 0 0 0 /dev/sda /dev/sg3 2 0 0 0 0 /dev/sdc /dev/sg4 3 0 0 0 0 /dev/sdd /dev/sg6 4 0 0 0 0 /dev/sdf [root@lnxa087 scripts]# for i in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > $i; done
Check again:
[root@lnxa087 etc]# [root@lnxa087 etc]# sg_map -x /dev/sg0 1 0 2 0 0 /dev/sdb /dev/sg1 1 0 0 0 0 /dev/sda /dev/sg2 2 0 2 0 0 /dev/sde /dev/sg3 2 0 0 0 0 /dev/sdc /dev/sg4 3 0 0 0 0 /dev/sdd /dev/sg5 3 0 2 0 0 /dev/sdg /dev/sg6 4 0 0 0 0 /dev/sdf /dev/sg7 4 0 2 0 0 /dev/sdh [root@lnxa087 etc]# /usr/sbin/multipath -ll mpatha (36005076801818664680000000000062d) dm-0 IBM ,2145 size=40G features='1 queue_if_no_path' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=50 status=active | |- 1:0:2:0 sdb 8:16 active ready running | |- 2:0:2:0 sde 8:64 active ready running | |- 3:0:2:0 sdg 8:96 active ready running | `- 4:0:2:0 sdh 8:112 active ready running `-+- policy='service-time 0' prio=10 status=enabled |- 1:0:0:0 sda 8:0 active ready running |- 2:0:0:0 sdc 8:32 active ready running |- 3:0:0:0 sdd 8:48 active ready running `- 4:0:0:0 sdf 8:80 active ready running
[root@lnxb603n /root]$ multipath -ll mpathj (3600507680181866468000000000012fd) dm-5 IBM,2145 size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=50 status=active | |- 1:0:0:1 sdb 8:16 active ready running | `- 4:0:0:1 sdn 8:208 active ready running `-+- policy='service-time 0' prio=10 status=enabled |- 1:0:3:1 sdd 8:48 active ready running `- 4:0:3:1 sdp 8:240 active ready running [root@lnxb603n /root]$ rescan-scsi-bus.sh [root@lnxb603n /root]$ for i in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > $i; done [root@lnxb603n /root]$ multipath -ll mpathj (3600507680181866468000000000012fd) dm-5 IBM,2145 size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=50 status=active | |- 1:0:0:1 sdb 8:16 active ready running | `- 4:0:0:1 sdn 8:208 active ready running `-+- policy='service-time 0' prio=10 status=enabled |- 1:0:3:1 sdd 8:48 active ready running `- 4:0:3:1 sdp 8:240 active ready running [root@lnxb603n /root]$ /sbin/mpathconf --find_multipaths y [root@lnxb603n /root]$ multipath -v3 [root@lnxb603n /root]$ multipath -ll mpathj (3600507680181866468000000000012fd) dm-5 IBM,2145 size=40G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw |-+- policy='service-time 0' prio=50 status=active | |- 1:0:0:1 sdb 8:16 active ready running | |- 2:0:0:1 sdf 8:80 active ready running | |- 3:0:0:1 sdj 8:144 active ready running | `- 4:0:0:1 sdn 8:208 active ready running `-+- policy='service-time 0' prio=10 status=enabled |- 1:0:3:1 sdd 8:48 active ready running |- 2:0:3:1 sdh 8:112 active ready running |- 3:0:3:1 sdl 8:176 active ready running `- 4:0:3:1 sdp 8:240 active ready running
Device not discover on a new IOgroup
Do a deeper rescan to login to the new SVC nodes
for i in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > $i; done
[root@lnx001 /root/scripts]$ systool -c scsi_host -v Class = "scsi_host" Class Device = "host0" Class Device path = "/sys/devices/vio/30000002/host0/scsi_host/host0" active_mode = "Initiator" can_queue = "100" cmd_per_lun = "16" config = eh_deadline = "off" host_busy = "0" host_reset = <store method only> mad_version = "1" nr_hw_queues = "1" os_type = "3" partition_name = "VIOS01" partition_number = "2" proc_name = "ibmvscsi" prot_capabilities = "0" prot_guard_type = "0" scan = <store method only> sg_prot_tablesize = "0" sg_tablesize = "128" srp_version = "16.a" state = "running" supported_mode = "Initiator" uevent = unchecked_isa_dma = "0" unique_id = "0" use_blk_mq = "1" vhost_loc = "U9009.22G.xxxxxxx-V20-C2-T1" vhost_name = "vhost13" Device = "host0" Device path = "/sys/devices/vio/30000002/host0" uevent = "DEVTYPE=scsi_host" Class Device = "host1" Class Device path = "/sys/devices/vio/30000003/host1/scsi_host/host1" active_mode = "Initiator" can_queue = "100" capabilities = "105d" cmd_per_lun = "16" device_name = "vfchost21" drc_name = "U9009.22G.78D0270-V2-C38" eh_deadline = "off" host_busy = "0" host_reset = <store method only> log_level = "2" npiv_version = "2" nr_hw_queues = "1" nr_scsi_channels = "1" partition_name = "VIOS01" port_loc_code = "U78D3.001.xxxxxxx-P1-C10-T2" proc_name = "ibmvfc" prot_capabilities = "0" prot_guard_type = "0" scan = <store method only> sg_prot_tablesize = "0" sg_tablesize = "128" state = "running" supported_mode = "Initiator" trace = "▒G{e" uevent = unchecked_isa_dma = "0" unique_id = "1" use_blk_mq = "1" Device = "host1" Device path = "/sys/devices/vio/30000003/host1" uevent = "DEVTYPE=scsi_host"