1834206 Members
2159 Online
110066 Solutions
New Discussion

Re: Vgchange Question

 
SOLVED
Go to solution
cuppajo
Advisor

Vgchange Question

While a SG'ed system is running, in production, can one safely perform a "vgchange -a n" on a VG which has mounted SG filesystems? Will it unmount the filesystems in that VG? Will it screw up the Serviceguard package? I created a new filesystem for a package and need to export the vgmap to the other nodes, and it says I need to vgchange -a n first. Thanks.
7 REPLIES 7
Patrick Wallek
Honored Contributor
Solution

Re: Vgchange Question

>>safely perform a "vgchange -a n" on a VG
>>which has mounted SG filesystems?

No, you will get an error if you try to deactivate a VG without mounted file systems.

>>I created a new filesystem for a package and
>>need to export the vgmap to the other nodes,

Add the '-p' (preview) option.

# vgexport -m mapfile -s -p vg??

S. Ney
Trusted Contributor

Re: Vgchange Question

I've attached a how to doc with instructions. The answer to your question depends on whether or not the volume group was created with the package up or down.

If the VG was created with the package down, deactivate the VG:
# vgchange -a n vg01

Create a map file prior to vgimport'ing the VG on other nodes.
# vgexport -pvs -m /etc/lvmconf/map.vg01 vg01

Copy the map file to the other nodes. Example:
# rcp /etc/lvmconf/map.vg01(othernode):/etc/lvmconf/map.vg01
NOTE: "othernode" is a reference to the hostname of the destination server




cuppajo
Advisor

Re: Vgchange Question

Yes, Sandi, my instructions are like that. Just wasn't sure if I should vgchange -a n when the vg has mounted filesystems running. No one likes an outage.
Patrick Wallek
Honored Contributor

Re: Vgchange Question

Absolutely NO NEED to deactivate the VG to create your map file. Follow my instructions above and you will be fine!

How the VG was create is not relevant.
Emil Velez
Honored Contributor

Re: Vgchange Question


Volume groups cannot be deactivated if filesystems are mounted and in use.

If filesystems that a package mounts in manually umounted and a volume group deactivated while a package is running it can be done but if the package then tries to shutdown it will experience errors running the stop script since the LVs and VGs are already unmounted. This will be a run script error.

Normally when a serviceguard package shuts down it does a

fuser -ku

of each mount point that belongs to a package so it can umount the filesystems.

You can create a new volume group and filesystem and export the volume group with a preview mode to create a map file so you can import it on the other node.

If you are real careful you could add the vgs and LVs to the package and hope that you edited the script right when it shuts down.

I would suggest that you shutdown the package first, add the VG and LVs to the package and start the new larger package to test it and make sure it starts and stops everything.

I hope this helps.

sujit kumar singh
Honored Contributor

Re: Vgchange Question

Hello

i assume that you have made an LV on a VG that is already activated and the Filesystems are already mounted by the package.

but if this new FS is to be used by the package, this also needs to have an entry on the Filsystem Check and Mount Entries in the package Control file on both the nodes, which shall ensure that the New LV that you have created for that package gets checked and mounted automatically with the package start.

this is additional thoght that you need to have while creating a new LV on a VG that is activated by the package.
also you need to craete the MountPoint directory to mount that LV on both the nodes.


The actual suggested way to add a filesystem to a package is to do so by taking that package down.

Also that helps you remain ensured after doing a package start and halt test on both the nodes.

yes

ON node1
#vgexport -p -v -s -m /tmp/vgXX.mapfile /dev/vgXX
#rcp -p /tmp/vgXX.mapfile :/tmp/
on node2
#vgexport /dev/vgXX
#mkdir /dev/vgXX
#mknod /dev/vgXX/group c 64 0xAAAAAA
keep this minor no 0xAAAAAA the same as that on the pry node node1
#vgimport -v -s -m /tmp/vgXX.mapfile /dev/vgXX

make necessary mount point dirctories on both node1 and node2


edit the package conf file on both the nodes to add entry for checkand mount of this LV.


Check by starting/halting the package on both the nodes.

so that you are sure that in case of a failover scenario to the node2 the package starts and runs satisfactorily.


regards
sujit



cuppajo
Advisor

Re: Vgchange Question

Fantastic. Thanks for all your help.