This is a short script for identifying 3 PAR disks allocated to a physical server running Linux with multipathing enabled.
Put the disk WWN details provided by the SAN admin in a file called detail.txt.
Now run the following for loop to extract the mpath devices corresponding to the disk WWNs.
#!/bin/bash
for i in `cat detail.txt | awk '{print $3}' | egrep -v 'showvlun|VV_WWN' | uniq -u`
do
echo "corresponding to
`cat detail.txt | awk '{print $3}' | egrep -v 'showvlun|VV_WWN' | uniq -u | grep -i $i` disk is
`multipath -ll | grep -i -A1 $i |awk '{print $1}'` "
done
The output of the script is as follows:
corresponding to
60002AC00000000000004BD20000935D disk is
mpathv
size=500G
corresponding to
60002AC00000000000004BD30000935D disk is
mpatht
size=500G
corresponding to
60002AC00000000000004BD40000935D disk is
mpaths
size=500G
corresponding to
60002AC00000000000004BD50000935D disk is
mpathu
size=500G
corresponding to
60002AC00000000000004BD60000935D disk is
mpathw
size=500G
Put the disk WWN details provided by the SAN admin in a file called detail.txt.
Now run the following for loop to extract the mpath devices corresponding to the disk WWNs.
#!/bin/bash
for i in `cat detail.txt | awk '{print $3}' | egrep -v 'showvlun|VV_WWN' | uniq -u`
do
echo "corresponding to
`cat detail.txt | awk '{print $3}' | egrep -v 'showvlun|VV_WWN' | uniq -u | grep -i $i` disk is
`multipath -ll | grep -i -A1 $i |awk '{print $1}'` "
done
The output of the script is as follows:
corresponding to
60002AC00000000000004BD20000935D disk is
mpathv
size=500G
corresponding to
60002AC00000000000004BD30000935D disk is
mpatht
size=500G
corresponding to
60002AC00000000000004BD40000935D disk is
mpaths
size=500G
corresponding to
60002AC00000000000004BD50000935D disk is
mpathu
size=500G
corresponding to
60002AC00000000000004BD60000935D disk is
mpathw
size=500G
No comments:
Post a Comment