NB: Linux Multipathing And (SAN) Disks
Some Linux shit stuff to do basic ops with FC.
T.B.D. a lot ;)
- Change scheuler and some params
- Offline some disks
- Remove some disks from the system
- Change disk params
- Identifing FC HBA
- Force LIP
- Change module parameter
- Check current module parameter
Change scheduler and some params:
lsscsi | grep OPEN-V | awk '{print "echo noop > /sys/block/"substr($6,6,length($6))"/queue/scheduler"}' | sh -x
lsscsi | grep OPEN-V | awk '{print "echo 2 > /sys/block/"substr($6,6,length($6))"/queue/rq_affinity"}' | sh -x
lsscsi | grep OPEN-V | awk '{print "echo 32 > /sys/block/"substr($6,6,length($6))"/queue/nr_requests"}' | sh -x
Remove all but one path in mpio config from exact disk:
multipath -ll /dev/disk/by-id/dm-name-360060e80164e000000014e0000000005 | grep ready | head -7 | awk '{print "echo offline > /sys/block/"{"/device/state"}' | sh -x
Offline and disconnect disks frome host:
lsscsi | egrep 'NETAPP' | awk '{print "echo offline > /sys/block/"substr($7,6,length($7))"/device/state"}' | sh -x
lsscsi | egrep 'NETAPP' | awk '{print "echo 1 > /sys/block/"substr($7,6,length($7))"/device/delete"}' | sh -x
lsscsi | egrep 'OPEN-V' | awk '{print "echo offline > /sys/block/"substr($6,6,length($6))"/device/state"}' | sh -x
lsscsi | egrep 'OPEN-V' | awk '{print "echo 1 > /sys/block/"substr($6,6,length($6))"/device/delete"}' | sh -x
- Pay attention ($7 and $6):
- NETAPP = LUN C-Mode
- HITACHI = OPEN-V
Changing some params:
lsscsi | grep OPEN-V | awk '{print "echo noop > /sys/block/"substr($6,6,length($6))"/queue/scheduler"}' | sh -x
lsscsi | grep OPEN-V | awk '{print "echo 2 > /sys/block/"substr($6,6,length($6))"/queue/rq_affinity"}' | sh -x
lsscsi | grep OPEN-V | awk '{print "echo 32 > /sys/block/"substr($6,6,length($6))"/queue/nr_requests"}' | sh -x
Defaults:
: scheduler = deadline
: add_random = 0
: rq_affinity = 1
: nr_requests = 128
Identifing HBA:
cat /sys/class/fc_host/host14/port_name
Forcelip:
echo 1 > /sys/class/fc_host/host14/issue_lip
Change kernel module parameter (e.g. qla2xxx)
modprobe -r qla2xxx
modprobe qla2xxx ql2xmaxqdepth=256
Check kernel module parameters (e.g. qla2xxx)
systool -v -m qla2xxx