Re: Script to check LVM mirror consistency Hello,
What you are looking to check is the strictness, not the
consistency. Consistency refers to the guarantee that once
lvm has something written to one mirrored copy, that it also has the
same information
written to the other copy.
Also, an addition to the previous script:
for VG in $(lsvg -o); do
for LV in $(lsvg -l $VG | egrep -v "MOUNT|N\/A|:" | awk '{print $1}');
do
lslv -M | awk '/:/{print;break} ($3==$5 && !/LP/){print "Mirror not
strict"}' | uniq
done
done
Of course this script only checks two copies of each lp.
I think, though that the question is why do you need to check the
mirror strictness?
If you set the lv to be strict for mirroring, then when you create the
mirror, lvm
should Do the Right Thing.
If somehow you have forgotten to set the strictness attribute, then I
think
the following should check, and fix:
# chlv -s y hd2
# reorgvg
(Of course this will use some bandwith to complete, and
for those using who are particular about disk placement,
this will possibly change that)
Hope this Helps,
Good Luck,
Casey |