Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script needed to check for logical volume mirroring

Status
Not open for further replies.

WiccaChic

Technical User
Jan 21, 2004
179
US
Hi all. Can someone donate a script? We do logical volume mirroring and I would like to have a fast way to verify all of our logical volumes are mirrored. This is necessary because we have a database that uses raw devices and we frequently have DBAs creating raw space/LVs for the database and sometimes they forget to mirror them.

Before anyone says it, I know this would be simpler if I mirrored at the hardware level, but I am stuck with what we have.

Thanks in advance!
 
HI,

The following command will print all LVs that have only one physical partition:

lsvg -l `lsvg`|grep -vE "TYPE|:"|awk '$5 ~ /1/ {print}'

Long live king Moshiach !
 
hi Wiccachic,

We use datalv1, datalv2, datalv3...and so on for our informix raw devices. You change "datalv" in the script to suit your your raw logical volumes.

the script goes

#!/bin/ksh

for lv in `lsvg -o | lsvg -i -l | grep sapdata|awk '{print $1}'`
do
copies=`lslv $lv | grep COPIES | awk '{print $2}'`
if [ $copies -lt 2 ]
then
echo "$lv is not mirrored"
fi
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top