vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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> |
| |||
| 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> |
| |||
| 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 |
| ||||
| unixsystems@gmail.com 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". |
| Thread Tools | |
| Display Modes | |
|
|