Re: Checking if the rootvg disk is mirrored
From: Hunter, Mark (Mark.Hunter_at_ANHEUSER-BUSCH.COM)
Date: 09/13/04
- Previous message: Antonio Vázquez: "Re: Checking if the rootvg disk is mirrored"
- Maybe in reply to: Antonio Vázquez: "Checking if the rootvg disk is mirrored"
- Next in thread: JOSEPH KREMBLAS: "Re: Checking if the rootvg disk is mirrored"
- Reply: JOSEPH KREMBLAS: "Re: Checking if the rootvg disk is mirrored"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 13 Sep 2004 14:07:55 -0500 To: aix-l@Princeton.EDU
Ummm... No.
VG Descriptors has nothing to do with mirroring.
If you have 1 drive in the vg, VG Des = 2
If you have 2 drives in the vg, VG Des = 3
If you have 3 drives or more in the vg, vg des = # of PVs
There is nothing in lsvg that can determine if mirroring is going on except lsvg
-l and checking if the number of PPs is > # of LPs for each lv.
You should also disable quorum if mirroring since if you lose half your drives
(common case of losing a drawer/rack) quorum would be lost but you should still
have access to all.
Here is what I use nightly on my systems:
integer num_val
for n in $(/usr/sbin/lsvg -o) # we have HA, so check active only
do
/usr/sbin/lsvg -l $n | tail +3 | awk '$2!="sysdump"{print $1}' - |
while read lv # sysdump should not be mirrored
do
num_val=$(/usr/sbin/lsattr -E -l $lv -a copies | awk '{print $2}' -)
if [ $num_val -ne 2 ]
then
unmirrored_lvs="$lv $unmirrored_lvs"
fi
done
num_val=$(/usr/sbin/lsvg $n | awk '/QUORUM/{print $NF}' -)
if [ $num_val -ne 1 ] # quorum bad for mirroring at copies=2
then
quorum_vgs="$n $quorum_vgs"
fi
val=$(/usr/sbin/lsvg $n | awk '/AUTO SYNC/{print $NF}' -)
if [ "$val" = "no" ] # autosync is good
then
nosync_vgs="$n $nosync_vgs"
fi
done
if [ ! -z "$unmirrored_lvs" ]
then
echo "UNMIRRORED_LVS = \"$unmirrored_lvs\""
else
echo "UNMIRRORED_LVS = \"None\""
fi
if [ ! -z "$quorum_vgs" ]
then
echo "QUORUM_TURNED_ON_VGS = \"$quorum_vgs\""
Else
echo "QUORUM_TURNED_ON_VGS = \"None\""
fi
if [ ! -z "$nosync_vgs" ]
then
echo "NOT_AUTO_SYNC_VGS = \"$nosync_vgs\""
else
echo "NOT_AUTO_SYNC_VGS = \"None\""
fi
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of Ray,
Mark
Sent: Monday, September 13, 2004 8:21 AM
To: aix-l@Princeton.EDU
Subject: Re: Checking if the rootvg disk is mirrored
Man, you guys are taking this mirror checking the hard way.
Just do an "lsvg rootvg"; if the number of volume descriptors in rootvg is
greater than the number of *physical* volumes, then you're mirroring.
Mark Ray
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of Jan-Frode
Myklebust
Sent: Friday, September 10, 2004 7:09 PM
To: aix-l@Princeton.EDU
Subject: Re: Checking if the rootvg disk is mirrored
On Fri, Sep 10, 2004 at 07:43:46PM -0300, Antonio Vázquez wrote:
>
> PD: Besides using "lslv -l rootvg | some_script_that_checks each LV
> and compares PPs with LPs"... but, if there´s no simple way to do it,
> I would accept a sample of that script! :)
Here's mine. I run it from cron nightly, because at some point we had a bug
where the mirrored LPs where on the same disk..
-------------------------------------------------------------------
#! /bin/ksh -
#
VOLUMES=`lsvg -l rootvg | awk '{if ($5 == "2") print $1}'` BROKEN=0 for volume
in $VOLUMES do
lslv -m $volume | egrep -q 'hdisk0.*hdisk0|hdisk1.*hdisk1' && \
BROKEN=1 && print "\nThe volume \"$volume\" is a broken mirror on node:
`hostname | tr -s [a-z] [A-Z]`"
done
if [[ "$BROKEN" -eq "1" ]]
then
print "\nUse \"lslv -m \$volume\" to inspect LP placement".
print "Use \"reorgvg rootvg \$volume\" to fix these mirror problems."
fi
-------------------------------------------------------------------
-jf
-----------------------------------------
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose it
to anyone else. If you received it in error please notify us immediately and
then destroy it.
- Previous message: Antonio Vázquez: "Re: Checking if the rootvg disk is mirrored"
- Maybe in reply to: Antonio Vázquez: "Checking if the rootvg disk is mirrored"
- Next in thread: JOSEPH KREMBLAS: "Re: Checking if the rootvg disk is mirrored"
- Reply: JOSEPH KREMBLAS: "Re: Checking if the rootvg disk is mirrored"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|