1835266 Members
2434 Online
110078 Solutions
New Discussion

lvextend progress

 
SOLVED
Go to solution
marty199
Occasional Advisor

lvextend progress

We're doing lvextend and it's extending. However how to know what extend progess it is., i.e. what percentage does current extending finish?
3 REPLIES 3
sujit kumar singh
Honored Contributor
Solution

Re: lvextend progress

say that the lvname is /dev/vg12/lvol1


lvdisplay -v /dev/vg12/lvol1 | grep -i stale | wc -l


or

for i in /dev/vg12/lvol*
do
lvdisplay -v $i | grep -i stale | wc -l
done

and run this after a while, you should be able to see that the count of stale PEs should decrease

regards
sujit
sujit kumar singh
Honored Contributor

Re: lvextend progress

hi


lvdisplay -v /dev/vg12/lvol1| wc -l

gives the count of all the PEs of the LV
whereas

lvdisplay -v /dev/vg12/lvol1 | grep -i stale| wc -l

gives the number of PEs that have not been mirrored.

James R. Ferguson
Acclaimed Contributor

Re: lvextend progress

Hi:

I assume you want to monitor a 'lvextend' operation to mirror a logical volume. Hence:

# 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...