Skip to content
Waldemar Mark Duszyk
AIX – poznajmy go razem
nie AIX •
Lekcje AIXu •
Lekcje HACMP •
Sutry •
Umysł •
mirroring progress in aix
If you wonder why AIX does not really have any tools to report on the progress of mirroring you
are mistaken. Every time you execute the lsvg command against a volume group is returns
(among others) the number of the Stale partitions. You could also execute the lsvg -M and count
the number of the stale partitions. Both of these options, executed at an interval will deliver the
decreasing numbers of stale partitions which could be used to generate the progress….
What you have here, are a few lines of code that provide the answer – nothing fancy.
#!/usr/bin/ksh93
### W.M. Duszyk, 3/2/12
### show percentage of mirrored PPs in a volume group
echo "Volume group $vg is mirrored $PercDone%."
If you decide to use this code (copy/paste), remember that each line above is really a single line of
characters!!! Your browser may distort this fact.
Have a good weekend!
UPDATE:
This script will work if the mirrorvg -S but not the syncvg command was used to create the
mirrors – the second command “locks” the volume groups being “synced” while the first one does
not.
Posted in Real life AIX, scripts.
Page 1 of 10 mirroring progress in aix – Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Tagged with mirroring, mirrorvg, progress, syncvg.
3 comments
By MarkD:-) – 2 March 2012
3 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Sebastian says
@Ramon: good idea using lscg -L to go get the data even when the vg is locked
5 March 2012, 2:35
1.
Mark says
I got to remember to use awk and its print function instead of using grep and awk ……
By the way, I think this will not work. I see you are trying to see if there are STALE
partitions, but you need to get their number too.
Thx
2 March 2012, 14:12
2.
Ramon says
A different version:
#!/usr/bin/ksh93
### W.M. Duszyk, 3/2/12
### show percentage of mirrored PPs in volume group
[[ $# < 1 ]] &vg=$1
# Changed to evade LVM locks
# Stale=`lsvg $vg | grep 'STALE PPs:' | awk '{print $6}'`
Stale=$(lsvg -L $vg | awk '/STALE PPs:/ {print $6}')
[[ $Stale = 0 ]] &# Changed to evade LVM locks
# Total=`lsvg $vg | grep 'TOTAL PPs:' | awk '{print $6}'`
Total=$(lsvg -L $vg | awk '/TOTAL PPs:/ {print $6}')
PercDone=$(( 100 – $(( $(( Stale * 100.0 )) / $(( Total / 2.0 )) )) ))
echo "Volume group $vg is mirrored $PercDone%."
2 March 2012, 13:42
3.
Page 2 of 10 mirroring progress in aix – Waldemar Mark Duszyk
22/03/2012 http://www.wmduszyk.com/?p=8133&langswitch_lang=pl
Share |
Leave a Reply
Some HTML is OK
Name (required)
Email (required, but never shared)
Web
Post comment or, reply to this post via trackback.
« mkuser does not work….. recovering “lost” mpio disks »
Subscribe