cancel
Showing results for 
Search instead for 
Did you mean: 

vgdisplay output and MCSG

 
SOLVED
Go to solution
Highlighted
Rick Garland
Honored Contributor

vgdisplay output and MCSG

Hi all:

Working with HPUX 11.23, MCSG 11.16, ia64 systems.

Trying to write a script that uses the vgdisplay command. Trouble is I do not want the VGs that are not activated.

Tried using grep -v, parsing through the /etc/lvmtab file, etc.

Any hints?

Thanks

4 REPLIES 4
Highlighted
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: vgdisplay output and MCSG

Well, if you don't want the scripts that are not activated then this is rather simple.

After getting your VG name from /etc/lvmtab then:

vgdisplay -v ${VGNAME} > /dev/null 2>&1
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then # ok
vgdisplay -v ${VGNAME}
fi

If it ain't broke, I can fix that.
Highlighted
Mel Burslan
Honored Contributor

Re: vgdisplay output and MCSG

the only solution I could find to this

vgdisplay | grep -v "not activated" | grep -v "Cannot display" > /tmp/file

and the output is the details from active groups only. error messages dump to screen. for some bizzare reason I could not get itto work with 2>/dev/null directive.

HTH
________________________________
UNIX because I majored in cryptology...
Highlighted
Mel Burslan
Honored Contributor

Re: vgdisplay output and MCSG

shorter form

vgdisplay 2>/dev/null
________________________________
UNIX because I majored in cryptology...
Highlighted
Rick Garland
Honored Contributor

Re: vgdisplay output and MCSG

Thanks Clay.

Mel - I was having similar issues as well.

Thanks to both of you!