Operating System - HP-UX
1833873 Members
3393 Online
110063 Solutions
New Discussion

Re: Howto get VolumeGroup information while a VG is not active

 
William Wan_1
Frequent Advisor

Howto get VolumeGroup information while a VG is not active

Hi Guys,

For a system consistency check program, I need to gather VG information of all active and in-active VG/LV on regular base.

I know that to use vgdisplay and other LVM-commando's, the VG must be active whih the corresponding PV.
I tried vgcfgrestore -n vgxx -l, but it returns the name of the corresponding PV of that VG configuration file.

But I am wondering if anyone has some wonderfull idea for my problem.

Again, my situation is:

1: able to gather all VG/LV configuration on regular base ( information like strict mode, PE size, LV name, number of mirrors etc )

2: Not all VG are active. Some VG's can only be active once in a long while (maybe up to 3 months due to the application/package restriction)

Thanks for any kind of help / discussion in advance.

Regards,

William
6 REPLIES 6
Rick Garland
Honored Contributor

Re: Howto get VolumeGroup information while a VG is not active

To get the LV names, you can go into the /dev/vg directory and list the contents. The LV names will be there.

Is the a MCSG config? If so, are the VGs active on another node? Do the vgdisplay there.
Devender Khatana
Honored Contributor

Re: Howto get VolumeGroup information while a VG is not active

Hi,

It is not possible to find these informations about the VG's without activating them. The only thing you can find without activating will be the disks and LVOLs belonging to these VGs.

#strings /etc/lvmconf/vgxx.mapfile
&
#strings /etc/lvmconf/vgxx.conf can be used for this.

Also try SAM if it helps a bit here.

HTH,
Devender
Impossible itself mentions "I m possible"
Gary L. Paveza, Jr.
Trusted Contributor

Re: Howto get VolumeGroup information while a VG is not active

You can always attempt the vgdisplay, and if it fails, then try to do a vgchange -a r on the volume group (activate in read-only mode). If that succeeds, then vgdisplay it and then vgchange -a n it.
G. Vrijhoeven
Honored Contributor

Re: Howto get VolumeGroup information while a VG is not active

Hi Willam,

If you are using MC/SG you can activate the volumegroup readonly do a vgcfgbackup and deactivate the vg again.

so
vgchange -a r /dev/vg?? && vgcfgbackup && vgdisplay -v vg?? && lvdisplay -v /dev/vg??/lvol? && vgchange -a n

HTH,

Gideon
William Wan_1
Frequent Advisor

Re: Howto get VolumeGroup information while a VG is not active

Thanks for all the help.

From the etc/lvmconf/vgxx.conf or /etc/lvmconf/vgxx.mapfile I can only retrieve information related to the PV.

I need to gather VG/LV information without activatating a VG at all.

I know that the VG information is store in the VG itself, without activating it, there is no way to discover them.

What I am wondering if there is anyother tools/application which keep the changes like vgcfgbackup/vgcfgrestore

unfortunataly, vgcfgbackup only store the information related to PV.

Regards,

William
Geoff Wild
Honored Contributor

Re: Howto get VolumeGroup information while a VG is not active

As far as I know, there is no way to get the info you want without activating the vg.

What you will need to do, is perform regular vgdisplay -v's and save the info when those vg's are activated.

That said - you can activate a vg at anytime (as long as it isn't active on another host) - and you don't need to mount the file systems associated with it - so it won't harm your running application.

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.