Re: Script to check LVM mirror consistency



unixsystems@xxxxxxxxx schrieb:
Here's a 2 minute bit of korn shell to get you started (apologies about
the tabs not working);

for VG in $(lsvg -o); do
for LV in $(lsvg -l $VG | egrep -v "MOUNT|N\/A|:" | awk '{print $1}');
do
print -n "$LV :"
lslv -m $LV | awk '{print $3" "$5}' | uniq
print ""
done
done

Hope this helps.

alex wrote:
Has anybody a fast script (perl, ksh or whatever) that can
check the output of

# lslv -m {lvname_xx}

of all logical volumes on all volume groups on an lpar?

A mirror is only consistent, when PP1 and PP2 are on
different physical volumes.

f.e.

root@lpar1:/home>lslv -m hd2
hd2:/usr
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0208 hdisk0 0208 hdisk1
0002 0209 hdisk0 0209 hdisk1
0003 0214 hdisk0 0210 hdisk1
0004 0215 hdisk0 0211 hdisk1
0005 0216 hdisk0 0212 hdisk1
0006 0217 hdisk0 0213 hdisk1
0007 0218 hdisk0 0214 hdisk1
0008 0219 hdisk0 0215 hdisk1
0009 0220 hdisk0 0216 hdisk1
0010 0221 hdisk0 0217 hdisk1
0011 0222 hdisk0 0218 hdisk1
0012 0223 hdisk0 0219 hdisk1
0013 0224 hdisk0 0220 hdisk1
0014 0225 hdisk0 0221 hdisk1
0015 0226 hdisk0 0222 hdisk1
0016 0227 hdisk0 0223 hdisk1
0017 0229 hdisk0 0224 hdisk1
0018 0230 hdisk0 0225 hdisk1
0019 0231 hdisk0 0226 hdisk1
0020 0232 hdisk0 0227 hdisk1
0021 0233 hdisk0 0228 hdisk1
0022 0234 hdisk0 0229 hdisk1
0023 0235 hdisk0 0230 hdisk1
0024 0236 hdisk0 0231 hdisk1
0025 0237 hdisk0 0232 hdisk1
0026 0238 hdisk0 0233 hdisk1
0027 0239 hdisk0 0234 hdisk1
0028 0240 hdisk0 0235 hdisk1
0029 0241 hdisk0 0236 hdisk1
0030 0242 hdisk0 0237 hdisk1
root@lpar1:/home>



That's very nice, if you know by the name, to what "side" hdiskx belongs.
A compare of the PVIDs of the hdiskx would show if the mirror-copy is
on the other "hdisk"-side.
Think of two storage systems on two locatitions, which both
have named their pvs "hdiskx".

.



Relevant Pages

  • [Q] Rootvg VGDA bad block???
    ... we break the mirror and make ... lsvg: Volume group descriptor area has a bad block." ... can I boot from hdisk1? ... Volume group descriptor area has a bad block. ...
    (AIX-L)
  • Re: [Q] Rootvg VGDA bad block???
    ... Why are you breaking the mirror to do a mksysb backup in the first place? ... lsvg: Volume group descriptor area has a bad block." ... If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all electronic and hard copies of the communication, including attachments. ...
    (AIX-L)
  • Re: Choose me a pump
    ... > I must get my online orderin this evening, for my new lights, Air ... > Horn, mirror and I want a ... alex@ the same domain will reach me ...
    (uk.rec.cycling)
  • Re: [Q] Rootvg VGDA bad block???
    ... Why are you breaking the mirror to do a mksysb backup in the first place? ... Rootvg VGDA bad block??? ... lsvg: Volume group descriptor area has a bad block." ...
    (AIX-L)
  • Re: New signing?
    ... Hello, Alex! ... A> From the Mirror today: ... A> "But the mediocre fare in the first half was soon forgotten as ... Prev by Date: ...
    (uk.sport.football.clubs.liverpool)