1833017 Members
2111 Online
110048 Solutions
New Discussion

Information about mirror

 
SOLVED
Go to solution
castro_2
Regular Advisor

Information about mirror

I need information of mirror for several systems, something like that
echo "Information Volume Groups ..." >> `hostname`.log
echo >> `hostname`.log
for i in `vgdisplay | grep Name |awk '{print $3}'`
do
echo "Information the Logical Volumes for the el VG: `echo $i|cut -b 6-10` " >> `hostname`log
echo >> `hostname`.log
for j in $i/lv*
do
lvdisplay $j >> `hostname`.log
echo --------------------------------------------- >> `hostname`.log
echo >> `hostname`.log
done
done

The name of logical volume sometimes is lvolX but others is saX or TN*

Thanks
1 REPLY 1
Rajeev  Shukla
Honored Contributor
Solution

Re: Information about mirror

Hi Castro,
Try this i made specially for you.
#!/usr/bin/sh
echo "Information Volume Groups.." >>`hostname`.log
echo >>`hostname`.log
for i in `vgdisplay -v|grep "LV Name"|awk '{print $3}'`
do
lvdisplay $i|egrep -e "LV Name" -e "Mirror copies" >>`hostname`.log
done
echo "--------------------------------------------" >>`hostname`.log


You can either have whole lvdisplay or just the mirror copies as i am taking.
Note one thing i am doing only one loop instead of two.

Cheers
Rajeev