###########如果扫不到盘;可根据lsluns看到得链路确认需要删除的无效链路。################
1、第一步:lsluns确认有几块盘。看到几块有几块。
Scanning for LUNs on adapter 0.0.0001
at port 0x500507680c17c768:
0x0000000000000000
0x0001000000000000
0x0002000000000000
0x0003000000000000
0x0004000000000000
0x0005000000000000
0x0006000000000000
0x0007000000000000
0x0008000000000000
0x0009000000000000
0x000a000000000000
0x000b000000000000
0x000c000000000000
0x000d000000000000
0x000e000000000000
0x000f000000000000
0x0010000000000000
0x0011000000000000
0x0012000000000000
0x0013000000000000
0x0014000000000000
0x0015000000000000
0x0016000000000000
0x0017000000000000
0x0018000000000000
0x0019000000000000
0x001a000000000000
0x001b000000000000
0x001c000000000000
0x001d000000000000
0x001e000000000000
0x001f000000000000
0x0020000000000000
0x0021000000000000
0x0022000000000000
0x0023000000000000
0x0024000000000000
0x0025000000000000
0x0026000000000000
0x0027000000000000
0x0028000000000000
0x0029000000000000
0x002a000000000000
第二步:查看luns得信息。
bddjsjbsr1:~ # lszfcp -D -P -H |grep 0x0028000000000000
0.0.0001/0x500507680c17c7a6/0x0028000000000000 0:0:0:40
0.0.0001/0x500507680c17c768/0x0028000000000000 0:0:1:40
0.0.0002/0x500507680c26c7a6/0x0028000000000000 1:0:0:40
0.0.0002/0x500507680c26c768/0x0028000000000000 1:0:1:40
0.0.0003/0x500507680c17c7a6/0x0028000000000000 2:0:0:40
0.0.0003/0x500507680c17c768/0x0028000000000000 2:0:1:40
0.0.0004/0x500507680c26c7a6/0x0028000000000000 3:0:0:40
0.0.0004/0x500507680c26c768/0x0028000000000000 3:0:1:40
第三步:已识别的盘。会有像如下返回值。
bddjsjbsr1:~ # lszfcp -D -P -H |grep 0x002a000000000000
0.0.0001/0x500507680c17c7a6/0x002a000000000000 0:0:0:42
0.0.0001/0x500507680c17c768/0x002a000000000000 0:0:1:42
0.0.0002/0x500507680c26c7a6/0x002a000000000000 1:0:0:42
0.0.0002/0x500507680c26c768/0x002a000000000000 1:0:1:42
0.0.0003/0x500507680c17c7a6/0x002a000000000000 2:0:0:42
0.0.0003/0x500507680c17c768/0x002a000000000000 2:0:1:42
0.0.0004/0x500507680c26c7a6/0x002a000000000000 3:0:0:42
0.0.0004/0x500507680c26c768/0x002a000000000000 3:0:1:42
bddjsjbsr1:~ # multipath -ll | grep 0:0:0:42
|- 0:0:0:42 sdlc 67:416 active ready running
如查看没有返回信息。则为扫不出来的盘/或未识别到的盘。
bddjsjbsr1:~ # lszfcp -D -P -H |grep 0x0028000000000000
0.0.0001/0x500507680c17c7a6/0x0028000000000000 0:0:0:40
0.0.0001/0x500507680c17c768/0x0028000000000000 0:0:1:40
0.0.0002/0x500507680c26c7a6/0x0028000000000000 1:0:0:40
0.0.0002/0x500507680c26c768/0x0028000000000000 1:0:1:40
0.0.0003/0x500507680c17c7a6/0x0028000000000000 2:0:0:40
0.0.0003/0x500507680c17c768/0x0028000000000000 2:0:1:40
0.0.0004/0x500507680c26c7a6/0x0028000000000000 3:0:0:40
0.0.0004/0x500507680c26c768/0x0028000000000000 3:0:1:40
bddjsjbsr1:~ # multipath -ll | grep 0:0:0:42
bddjsjbsr1:~ # multipath -ll | grep 0:0:0:40
bddjsjbsr1:~ # multipath -ll | grep 0:0:1:40
bddjsjbsr1:~ # multipath -ll | grep 1:0:0:40
bddjsjbsr1:~ # multipath -ll | grep 1:0:1:40
bddjsjbsr1:~ # multipath -ll | grep 2:0:0:40
bddjsjbsr1:~ # multipath -ll | grep 2:0:1:40
bddjsjbsr1:~ # multipath -ll | grep 3:0:0:40
bddjsjbsr1:~ # multipath -ll | grep 3:0:1:40
########################################################
#######此方法为老方法扫盘,需要执行全部链路号(不推荐)#########
########################################################
确认没有扫出得盘,针对性扫盘。
先删除已存在得链路,并重新扫盘,盘即可扫出。使用如下命令
扫盘添加路径:尾数为1
zfcp_disk_configure 0.0.0004 0x500507680c26c7a6 0x002e000000000000 1
删除路径:尾数为0
zfcp_disk_configure 0.0.0004 0x500507680c26c7a6 0x002e000000000000 0
################################################################
#############如已识别到盘;但缺少链路通道。#####################
################################################################
multipath -l 已识别到磁盘的正常信息 如下:
asm13 (3600507680c81063d380000000000028c) dm-19 IBM,2145
size=1.0T features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| |- 2:0:1:18 sdcb 68:240 active undef running
| |- 3:0:1:18 sdbm 68:0 active undef running
| |- 0:0:1:18 sdcc 69:0 active undef running
| `- 1:0:1:18 sdbs 68:96 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
|- 2:0:0:18 sdhn 133:208 active undef running
|- 3:0:0:18 sdho 133:224 active undef running
|- 0:0:0:18 sdhl 133:176 active undef running
`- 1:0:0:18 sdhm 133:192 active undef running
multipath -l 已识别到磁盘的但是链路不全信息 如下:
3600507680c81063d38000000000005e2 dm-51 IBM,2145
size=100G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| |- 2:0:0:39 sdks 67:256 active undef running
| |- 3:0:0:39 sdkt 67:272 active undef running
| |- 1:0:0:39 sdkr 66:496 active undef running
| `- 0:0:0:39 sdkq 66:480 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
`- 0:0:1:39 sdlj 68:272 active undef running
添加缺少链路不全信息:
#lszfcp -D -P -H |grep 0x0028000000000000
0.0.0001/0x500507680c17c7a6/0x0028000000000000 0:0:0:40
0.0.0001/0x500507680c17c768/0x0028000000000000 0:0:1:40
0.0.0002/0x500507680c26c7a6/0x0028000000000000 1:0:0:40
0.0.0002/0x500507680c26c768/0x0028000000000000 1:0:1:40
0.0.0003/0x500507680c17c7a6/0x0028000000000000 2:0:0:40
0.0.0003/0x500507680c17c768/0x0028000000000000 2:0:1:40
0.0.0004/0x500507680c26c7a6/0x0028000000000000 3:0:0:40
0.0.0004/0x500507680c26c768/0x0028000000000000 3:0:1:40
添加缺少链路:
zfcp_disk_configure 0.001 0x500507680c17c7a6 0x0028000000000000 0
zfcp_disk_configure 0.001 0x500507680c17c7a6 0x0028000000000000 1
zfcp_disk_configure 0.002 0x500507680c17c768 0x0028000000000000 0
zfcp_disk_configure 0.002 0x500507680c17c768 0x0028000000000000 1
zfcp_disk_configure 0.003 0x500507680c17c7a6 0x0028000000000000 0
zfcp_disk_configure 0.003 0x500507680c17c7a6 0x0028000000000000 1
zfcp_disk_configure 0.004 0x500507680c17c768 0x0028000000000000 0
zfcp_disk_configure 0.004 0x500507680c17c768 0x0028000000000000 1
multipasth -l 即可查看。
suse11版本扫盘新方法 脚本扫盘(推荐):
第一步:确认有效光纤卡和磁盘
lsluns| grep LUNs
Scanning for LUNs on adapter 0.0.0001
Scanning for LUNs on adapter 0.0.0002
Scanning for LUNs on adapter 0.0.0003
Scanning for LUNs on adapter 0.0.0004
Scanning for LUNs on adapter 0.0.0005
Scanning for LUNs on adapter 0.0.0006
Scanning for LUNs on adapter 0.0.0007
Scanning for LUNs on adapter 0.0.0008
一般光纤卡是从0.0.0001到8或者其他的情况,比如0.0.0007/8/9/a等其他情况,有效的光纤卡下面的链路下面是会有磁盘的,示例的有效磁盘就是0.0.0001-0.0.0004
有效磁盘直接用lsluns查看有磁盘的链路就可以,如果svc存储添加完磁盘映射,系统的lsluns下的磁盘数量就会增多,所以经过系统的lsluns的磁盘的数量是正确的。
第二步:查询链路
zfcp_san_disc -W -b 0.0.0001
0x500507680c17c75c
0x500507680c17c784
zfcp_san_disc -W -b 0.0.0002
0x500507680c17c75c
0x500507680c17c784
zfcp_san_disc -W -b 0.0.0003
0x500507680c26c75c
0x500507680c26c784
zfcp_san_disc -W -b 0.0.0004
0x500507680c26c75c
0x500507680c26c784
第三步:lsluns查询信息,并将新的wwwpn替换。
vim add_lsluns.sh
#!/bin/bash
declare -i nu=0
echo '0x0000000000000000
0x0001000000000000
0x0002000000000000
0x0003000000000000
0x0004000000000000
0x0005000000000000
0x0006000000000000
0x0007000000000000
0x0008000000000000
0x0009000000000000
0x000a000000000000
0x000b000000000000
0x000c000000000000
0x000d000000000000
0x000e000000000000
0x000f000000000000'| while read I
do
let nu++
zfcp_disk_configure 0.0.0001 0x500507680c17c75c $I 1
zfcp_disk_configure 0.0.0001 0x500507680c17c784 $I 1
zfcp_disk_configure 0.0.0002 0x500507680c17c75c $I 1
zfcp_disk_configure 0.0.0002 0x500507680c17c784 $I 1
zfcp_disk_configure 0.0.0003 0x500507680c26c75c $I 1
zfcp_disk_configure 0.0.0003 0x500507680c26c784 $I 1
zfcp_disk_configure 0.0.0004 0x500507680c26c75c $I 1
zfcp_disk_configure 0.0.0004 0x500507680c26c784 $I 1
done
执行
bash -x add_lsluns.sh
如果原有部分磁盘解映射,系统又添加新的磁盘映射,会导致新加的磁盘的链路扫不出来,需要删除最近添加的几块磁盘的,建议1块删一次,然后扫一次,如果磁盘出来了就可以,不行的话就每次在原有的基础上多删除一块磁盘,防止删除过多
删盘方法:
vim delete_lsluns.sh
#!/bin/bash
declare -i nu=0
echo '0x000d000000000000
0x000e000000000000
0x000f000000000000'| while read I
do
let nu++
zfcp_disk_configure 0.0.0001 0x500507680c17c75c $I 0
zfcp_disk_configure 0.0.0001 0x500507680c17c784 $I 0
zfcp_disk_configure 0.0.0002 0x500507680c17c75c $I 0
zfcp_disk_configure 0.0.0002 0x500507680c17c784 $I 0
zfcp_disk_configure 0.0.0003 0x500507680c26c75c $I 0
zfcp_disk_configure 0.0.0003 0x500507680c26c784 $I 0
zfcp_disk_configure 0.0.0004 0x500507680c26c75c $I 0
zfcp_disk_configure 0.0.0004 0x500507680c26c784 $I 0
done
执行
bash -x delete_lsluns.sh