cd /root/storage/
cat scan.sh
#!/bin/bash
SLEEP_INTERVAL=30
echo "Scanning all fibre channel host adapters"
for i in `ls /sys/class/fc_host`
do
echo "Rescanning /sys/class/fc_host/${i}:"
echo " Issuing a loop initialization on ${i}:"
echo "1" > /sys/class/fc_host/${i}/issue_lip
echo " Scanning ${i} for new devices:"
echo "- - -" > "/sys/class/scsi_host/${i}/scan"
echo "Sleeping for ${SLEEP_INTERVAL} seconds"
sleep ${SLEEP_INTERVAL}
done
---
multipath -ll | egrep '0a43|0a44|0a45|0a46|0a47' | sort
Create a template for new voting disk and add them into EOF /etc/multipath.conf
multipaths {
##############VOTING##############
multipath {
wwid 360060e80166f440000016f4400000a46
alias asmvoting001
}
multipath {
wwid 360060e80166f440000016f4400000a47
alias asmvoting002
}
multipath {
wwid 360060e80166f440000016f4400000a44
alias asmvoting003
}
multipath {
wwid 360060e80166f440000016f4400000a45
alias asmvoting004
}
multipath {
wwid 360060e80166f440000016f4400000a43
alias asmvoting005
}
}
add the following lines into /etc/udev/rules.d/96-multipath-permission.rules
ACTION=="add|change", ENV{DM_UUID}=="*mpath-*" , ENV{DEVLINKS}=="/dev/mapper/asm*[a-z][0-9][0-9][0-9]*p1*", GROUP="oinstall", OWNER="grid", MODE="660"
multipath -F
service multipathd reload
multipath -ll | grep asm
multipath -ll | grep asm | sort
create a disk input file with the following content devlist
mapper/asmvoting001
mapper/asmvoting002
mapper/asmvoting003
mapper/asmvoting004
mapper/asmvoting005
vi devlist
mapper/asmvoting001
mapper/asmvoting002
mapper/asmvoting003
mapper/asmvoting004
mapper/asmvoting005
cat format_disk.sh
#! /bin/bash
ODEV="/oracle_asmdev";
if [ ! -d ${ODEV} ]
then
/bin/mkdir ${ODEV}
if [ $? -ne 0 ]
then
echo "mkdir ${ODEV} may have failed. Please investigate."
exit 1
fi
fi
check_disk() {
/bin/dd if=/dev/${1} of=/dev/null bs=1048576 count=10
if [ $? -ne 0 ]
then
echo "/dev/${1}p1 may not be configured correctly."
fi
}
setup_device() {
echo "2048,," | /sbin/sfdisk -uS /dev/${1} --force
/sbin/partprobe /dev/${1}
kpartx -a -v -p p /dev/${1}
}
setup_permission() {
fdisk -l /dev/${1};
#/bin/ln -s /dev/"$1"p1 $2
/bin/chown grid:oinstall $2
/bin/chmod 0640 $2
}
echo -n "Enter rac env:eg - pgr2>"
read env
for rec in `cat devlist`
do
asmrawdev=`echo $rec|cut -d"," -f1`
asmdir=`echo $rec|cut -d"," -f2`
echo "/dev/${asmrawdev}p1 -> ${ODEV}/$env-${asmdir}"
if [ -b /dev/${asmrawdev} ]
then
echo "setup_device $asmrawdev ${ODEV}/$env-${asmdir}"
setup_device $asmrawdev ${ODEV}/$env-${asmdir}
echo "setup_permission $asmrawdev ${ODEV}/$env-${asmdir}"
setup_permission $asmrawdev ${ODEV}/$env-${asmdir}
echo "check_disk ${asmrawdev} ${ODEV}/$env-${asmdir}"
check_disk ${asmrawdev} ${ODEV}/$env-${asmdir}
else
echo "/dev/${asmrawdev} does not exist"
fi
done
exit 0
--
on 2nd and 3rd node
just update the /etc/multipath.conf and into /etc/udev/rules.d/96-multipath-permission.rules file content same as first node
then scan for luns using the script /root/storage/scan.sh
---
multipath -F
service multipathd reload