Operating System - HP-UX
1834796 Members
3333 Online
110070 Solutions
New Discussion

How can I find out all active volume groups at my system

 
SOLVED
Go to solution
Mirko Schmidt
Advisor

How can I find out all active volume groups at my system

Hi @ All,

How can I find out all active volume groups at my system. I need the output for checkup script (like: vgxy1, vgxy2, vgxy3,....)

Thanks
Mirko
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: How can I find out all active volume groups at my system

Hi Mirko:

# vgdisplay

...without any arguments.

Regards!

...JRF...
Mirko Schmidt
Advisor

Re: How can I find out all active volume groups at my system

Hi,

I know this command, but the output is not usable for me, I need only the name of the volume group, vgdisplay is too much output.

Bye
Yarek
Regular Advisor

Re: How can I find out all active volume groups at my system

Hi,

I think following command could be useful

vgdisplay 2>/dev/null | more | grep "VG Name"



rgds.
James R. Ferguson
Acclaimed Contributor

Re: How can I find out all active volume groups at my system

Hi (again) Mirko:

OK, if you only want the vgname:

# vgdisplay |awk '/VG Name/ {print $3}'

Regards!

...JRF...
Yarek
Regular Advisor
Solution

Re: How can I find out all active volume groups at my system


or something similar:

vgdisplay 2>/dev/null | grep "VG Name" | awk -F"/" '{print $3}'


good luck!
Yarek
Regular Advisor

Re: How can I find out all active volume groups at my system


or something very similar:

vgdisplay 2>/dev/null | awk -F"/" '/VG Name/ {print $3}'

you should obtain only VG names without '/dev' prefix

Geoff Wild
Honored Contributor

Re: How can I find out all active volume groups at my system

Or a combo of James and Yarek's:

vgdisplay 2>/dev/null | awk -F"/" '/VG Name/ {print $3}'

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Mirko Schmidt
Advisor

Re: How can I find out all active volume groups at my system

Hi @ All,
thanks for the informations.

Bye
Mirko