cancel
Showing results for 
Search instead for 
Did you mean: 

Check Mirror resync process

SOLVED
Go to solution
balaji_vvv
Frequent Advisor

Check Mirror resync process

How to check percent completed when i'm remirroring after disk replacement due to a disk failure? In other words i need eqvalent command like veritas vxtask?
Currently i can only see through
"lvdisplay -v /dev/vgxx/lvolxx/ and to see stale/current?
9 REPLIES
James R. Ferguson
Acclaimed Contributor
Solution

Re: Check Mirror resync process

Hi:

There isn't a percentage complete. You can pipe the 'lvdisplay' to 'grep' and count the number of stale extents, though.

# lvdisplay -v /dev/vgXX/lvolNN|grep -c stale

...which will return the number of "stale" extents remaining.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: Check Mirror resync process

The process JRF mentions is exactly what I do to keep track of the remirroring process. There's nothing else to do that I know of.
Torsten.
Acclaimed Contributor

Re: Check Mirror resync process

More or less the same, if all of the lvols are named lvolx:

# lvdisplay -v /dev/vg_x/lvol* | grep stale | wc -l

the number is decreasing to zero.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Johnson Punniyalingam
Honored Contributor

Re: Check Mirror resync process

Hi Balaji,

All above post ,<>,


You can also try this,
=======================
while true
do
pvdisplay -v /dev/dsk/c2t6d0|grep stale|wc -l
sleep 5
done

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
James R. Ferguson
Acclaimed Contributor

Re: Check Mirror resync process

Hi (again):

Since 'grep -c stale' matches _and_ counts the lines containing the character sequence "stale", there is no need to spawn a 'wc' process. After all, the process you save, may be your own.

Regards!

...JRF...
balaji_vvv
Frequent Advisor

Re: Check Mirror resync process

That really helps!. Thank you all.
balaji_vvv
Frequent Advisor

Re: Check Mirror resync process

# lvdisplay -v /dev/vgXX/lvolNN|grep -c stale

# lvdisplay -v /dev/vg_x/lvol* | grep stale | wc -l
James R. Ferguson
Acclaimed Contributor

Re: Check Mirror resync process

Hi:

If you really wanted to report a percentage complete, you could monitor it like this:

# cat ./mirrorpct
#!/usr/bin/sh
LV=$1
[ -b "${LV}" ] || { echo "'${LV}' isn't a LV path"; exit 1; }
typeset -i PC=0
while (( ${PC} < 100 ))
do
PC=$(lvdisplay -v ${LV}|awk '/current/{C++};/stale/{S++};END{printf "%.1f\n",C/(C+S)*100}')
echo "${PC}% complete"
[ ${PC} -ge 100 ] || sleep 15
done
exit 0

...run as:

# ./mirrorpct /dev/vgNN/lvolX

The script will continually report the percent mirrored until (or if) it reaches 100%.

Regards!

...JRF...
mvpel
Trusted Contributor

Re: Check Mirror resync process

A Perl one-liner:

lvdisplay -v /dev/vg00/lvol7 | \
perl -n -e \
'/current/ && $c++; \
/stale/ && $s++; \
END {printf "%3.1f%% complete\n", \
$c / ($c + $s) * 100}'