Re: Checking if the rootvg disk is mirrored

From: Hunter, Mark (Mark.Hunter_at_ANHEUSER-BUSCH.COM)
Date: 09/13/04

  • Next message: Anil Maurya: "Please shed some light ."
    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.


  • Next message: Anil Maurya: "Please shed some light ."

    Relevant Pages

    • Re: Best Practices on Writes
      ... The mirroring (called Life Keeper Data ... writes are done simultaneously to both drives. ... > those writes in cache. ... >>> from last good backups anyway and the cache doesn't even come into play. ...
      (microsoft.public.sqlserver.setup)
    • Re: RAID syncronization - How often?
      ... As I was reading the Promise Array docs I came across this: ... Synchronization is a periodic maintenance procedure for Mirroring (RAID 1, ... 0+1, 3, and 5) arrays to maintain data consistency on all mirrored drives. ...
      (microsoft.public.windows.server.sbs)
    • Re: RAID 5 q - in simpler terms - THANKS!
      ... Of course it's now getting really really difficult to replace a 4 gig drives ... Please respond to IBM AIX Discussion List ... example, if its striped on disks 1-4, then all expansion will be on disks ... On your statement that no downtime is ever involved on mirroring, ...
      (AIX-L)
    • Re: External backup/restore - an idea - comments please
      ... After you copy off the unmirrored drives ... When I say mirrored I mean OS or drive vendor mirroring. ... SANS that did double mirroring for this kind of backup. ... Now this doesn't solve point in time backups using the logs. ...
      (comp.databases.informix)
    • Re: RAID 5 q - in simpler terms - THANKS!
      ... example, if its striped on disks 1-4, then all expansion will be on disks 1-4. ... Also, if you lose one disk in a stripe, the sync requires all disks in the stipe ... On your statement that no downtime is ever involved on mirroring, ... If the wrong two drives fail, ...
      (AIX-L)