Operating System - HP-UX
1752565 Members
5634 Online
108788 Solutions
New Discussion юеВ

Re: How can I able to view all the vg's(activated and non-activated) in a box??

 
SOLVED
Go to solution
kunjuttan
Super Advisor

How can I able to view all the vg's(activated and non-activated) in a box??

How can I able to view all the vg's(activated and non-activated) in a box??
9 REPLIES 9
Michael Steele_2
Honored Contributor
Solution

Re: How can I able to view all the vg's(activated and non-activated) in a box??

HI

This is a good question because if you're using power path the alternates don't get listed in /etc/lvmtab.

Use SAM. Its very reliable. It tells you which is free or being used and in which vg.

As far as activated vgs or unactivated vgs? I'm not sure if SAM gives you this information and aside from comparing mounted file systems to what's in the /etc/fstab file or /dev/*/group listings or /etc/lvmtab I'm not sure.

What happens when you do a vgdisplay -v which should list all vgs? (* don't specify a vg like vgdisplay vg00 *)
Support Fatherhood - Stop Family Law
Jupinder Bedi
Respected Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

you can use sam for it or otherwise you need do vgdisplay on all the VG's seprately to find out the status

also you can do is vgdisplay command only it will show you all the VGs with the status

All things excellent are as difficult as they are rare
Jupinder Bedi
Respected Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

also if you will do vgscan it will only scan the activated VG's in the /etc/lvmtab file.



Good luck
All things excellent are as difficult as they are rare
johnsonpk
Honored Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

Hi Dipesh,

vgdisplay comand will display all active VGs in the system and the standard error output will say about non active vgs

#vgdisplay |grep "VG Name" > /tmp/vgactive
then
#cat /tmp/vgactive will give you the active vgs name

and the standard error will contains details about non-active vgs



You can use the below simple script for finding the status of vgs and vg version


>/tmp/vgstatus
strings /etc/lvmtab |grep /dev |grep -v /dev/disk |grep -v /dev/dsk |while read vgname
do
vgdisplay $vgname |read dummy
if [ "$?" = "0" ] ; then
echo "$vgname" "Active" >>/tmp/vgstatus
else
echo "$vgname" "Non_Active" >>/tmp/vgstatus
fi
done
OSVER=`uname -r`
if [ "$OSVER" = "B.11.31" ] ; then
strings /etc/lvmtab_p |grep /dev |grep -v /dev/disk |grep -v /dev/dsk |while read vgname
do
vgdisplay $vgname |grep "VG Version" |awk '{print $3}' |read version
if [ "$?" = "0" ] ; then
echo "$vgname" "Active" "$version" >>/tmp/vgstatus
else
echo "$vgname" "Non_Active" "2.x" >>/tmp/vgstatus
fi
done
fi




then cat /tmp/vgstatus


regards
Johnson
T. M. Louah
Esteemed Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

List each VG with associated disk(s)
# strings /etc/lvmtab

Command vgidsplay will show each VG status
# vgdisplay |egrep "Name|Status"
Little learning is dangerous!
Johnson Punniyalingam
Honored Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

by doing simple "vgdisplay" will help to figure out vg's activated and non activated in a server

# vgdisplay -v
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16

LV Name /dev/vg00/lvol3

Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c1t0d0
PV Status available
Total PE 4340
Free PE 134
Autoswitch On
Proactive Polling On


vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg01"
Problems are common to all, but attitude makes the difference
AVV
Super Advisor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

Hello,

Appreciate for asking this question as many of us need some pin points to find out the free disk from many/alt path.

I am doing the below tasks to know the same not sure the easiness of this.

1. ioscan -fnC disk
2. pick up the disk you need or you want to check up
3. cross check it on # strings /etc/lvmtab | grep -i c#t#d#
4. vgdisplay -v | grep -i c#t#d#
5.pvdisplay /dev/dsk/c#t#d# <--It shows you the PE that are there in total as wellas used.
6.If you see the disk is not used, it can be usable now for you.

I know it is hard to go on but better way has to get from the GREAT GURUs....waiting :)
johnsonpk
Honored Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

Ajesh V.V >>>

>>Appreciate for asking this question as many of us need some pin points to find out the free disk from many/alt path.

>>I am doing the below tasks to know the same not sure the easiness of this.

If you are picking a disk which is an alternate path for a PV that is being used in one of the VG and that vg is not extended to the alternate path(that you picked) , you will end up being with wrong assumption as the pvdisplay on that alternate path will report that it is not part of any VG

Prasanth Thomas
Valued Contributor

Re: How can I able to view all the vg's(activated and non-activated) in a box??

Hi Dipesh,

Please run vgdisplay command thne you will get the information of all activated VGs.

< The vgdisplay command displays information about volume groups. For each vg_name specified, vgdisplay displays information for that volume group only. If no vg_name is specified, vgdisplay displays names and corresponding information for all defined volume groups.>

Regards,
Prasanth Thomas.