Validate mirroring for splitvg

Splitvg is a really cool feature of AIX 5L, but there is one problem. Each “copy”, must be on a different set of disks. Mirrored copies of each LV are numbered 1, 2, or 3 (1 for the first copy, 2 for the second, and 3 for the third). Splitvg has to be told which “copy” to split and recreate as a new VG. So, this means that all of the #1 copies must be on the same disks, and all of the #2 copies must be on different disks. Splitvg isn’t smart enough to work around this. So, there’s a quick little script to run on each PV in the volume group, if it’s all okay there won’t be any output:

for LV in `lspv -l $HDISK | tail +3 | awk '{ print $1 }'`
     count=`lslv -m $LV | tail +3 | awk '{ print $3 }' | grep -v -c $HDISK`
     if [ $count -gt 0 ]
          echo $LV

Leave a Reply

Your email address will not be published. Required fields are marked *