Operating System - HP-UX
1826063 Members
3891 Online
109690 Solutions
New Discussion

Re: Diactivating Voulme group

 
SOLVED
Go to solution
Shehan
Super Advisor

Diactivating Voulme group

Hi

How to deactivating volume group in EVA without a data corruption?

Regards
Nirukshitha
18 REPLIES 18
Steven E. Protter
Exalted Contributor
Solution

Re: Diactivating Voulme group

Shalom,

vgchange -a n

Even if there are file systems with open oracle databases, this command will not corrupt anything.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

hi


is that VG a part of any Service Guard package and if that package is a Normal Failover tpe package or a Multinode package?

That is is that a LVM VG used by a package or SLVM shared LVM using the Multinode type package?

if that is a Normal LVM VG(not SLVM) then halting the package shall deactivate that VG.

approach is somewhat different for a SLVM VG being accessed by a MUltinode package.


Howver if that is a normal and simple VG.

umount all the fileystems on all the LVs of the VG and then do a
#vgchange -a n


Regards
Sujit
Shehan
Super Advisor

Re: Diactivating Voulme group

Hi

This is normal and simple VGs. But Mutipath is configured.
Anyway I already used given "vgchange -a " command.Although volume group is deactivated, after rebooting the server, it was activated automatically. Do you know any option to disable volume group permanently untill activating manually.

Regards
Niru
Ivan Krastev
Honored Contributor

Re: Diactivating Voulme group

You should change AUTO_VG_ACTIVATE to 0 in /etc/lvmrc. If AUTO_VG_ACTIVATE=0 then only vg00 gets activated during startup.

For other volume groups add appropriate entries in custom_vg_activation function.

regards,
ivan
Shehan
Super Advisor

Re: Diactivating Voulme group

I we put AUTO_VG_ACTIVATE to 0, Other volume groups are also not activating after the reboot.

Anyway what does custom_vg_activation do? How do we configure in the system.Please give me a example.

Regards
Nirukshitha
Ivan Krastev
Honored Contributor

Re: Diactivating Voulme group

sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

hi

in /etc/lvmrc

the meaning of AUTO_VG_ACTIVATE=1 is that Activate all the VGs that are local to the system at the system boot.

AUTO_VG_ACTIVATE=0 ; means that do not activate any other VG in the system apart from the Root VG that is the Root Volume group from ewhcih the system Boots.

in the Requirement that is being faced here the custom_vg_activation can be used with AUTO_VG_ACTIVATE=0

with AUTO_VG_ACTIVATE=0; no other VG apart from the root VG shall activate and if custom_vg_activate entry for anotehr VG is made there like that one exapmpled there then that VG will also activate with the root VG at the boot and other VGs Shall not activate apart from the root VG and the VG that is mentioned under the custom_vg_activation.


thus seems that there is an entry for this VG in there which is causing that to get activated, that needs to be commented out.

is this sure that the VG is not getting activated by any Service Guard Cluster Package? and that the MAchine is not a ServiceGuard Cluster Node


Regards
Sujit
sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

hello Sir


please take some time to assign points to the answers that have been made to the queries from you.
you havw assigned point sto 4 out of 301 responses made.

please have a look at the following thread also.

http://forums1.itrc.hp.com/service/forums/helptips.
do?#33

regards
Sujit
Shehan
Super Advisor

Re: Diactivating Voulme group

Hi Sumit

I really assign points for you with this reply.

Anyway, my plan is to deactivate volume group using "vgchange -a n" command and going to set "AUTO_VG_ACTIVATE=0" option in order to disable boot volume group mounting option.After server is booted , I am going to activate only required VGs one by one using following commands.

/sbin/vgchange -a y -s /dev/vg01
/sbin/vgchange -a y -s /dev/vg02
/sbin/vgchange -a y -s /dev/vg03
/sbin/vgchange -a y -s /dev/vg04

Please correct if I am wrong.

once we activate volume groups one by one, do we need to mount lvol into mount points one by one?

Anyway there is no service guard cluster configured.

Regards
Niru


sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

hi


that is true.

this well help activating the root VG as well as the VGs that are mentioned in the custom_vg_activate to be activated at the boot time.


Once a VG is activated using the #vgchange -a y , the LVs are automatically available for mounting as filesystems.


Regards
Sujit

Regards
sujit
sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

Hi

one thing i missed, please do find that.


activating the VG shall make all the LVs in them to be used, but the mounting needs to be done manually for the LVs, or a script can serve the purpose.

the LVs need to be mounted manually after that if not put in the /etc/fstab.
However if the LVs are mentioned in the /etc/fstab and the VG is not acivated during the boot time, the errors like the Filesystem not found can be found as the system boot as the system shall try mont all the fileystems mentioned in the /etc/fstab.


Regards
sujit

Shehan
Super Advisor

Re: Diactivating Voulme group

Hi Sujit

Please see below my fully action plan for this.

1) Unmount all mount points using below script
# for f in $(bdf | grep vg | grep -v vg00 |awk '{print $1}')
> do
> echo Unmounting $f
> umount $f
> done

2) Deactivating all volume groups using below script

# for f in $(strings /etc/lvmtab | grep vg | grep -v vg00)
> do
> echo Deactivating volume group: $f
> vgchange -a n $f
> done

3)Edit /etc/lvmrc file in order to disable unwanted volume group activation at rebooting

# vi /etc/lvmrc
Enter following entries in lvmrc
AUTO_VG_ACTIVATE=0;

custom_vg_activation()
{
/sbin/vgchange -a y -s /dev/vg00
/sbin/vgchange -a y -s /dev/vg01
/sbin/vgchange -a y -s /dev/vg02
/sbin/vgchange -a y -s /dev/vg03
/sbin/vgchange -a y -s /dev/vg04
parallel_vg_sync "/dev/vg00 /dev/vg02 /dev/vg03 /dev/vg04 "

return 0
}

4) Edit /etc/fstab and comment unwanted mount points in order to not to mount while booting.

5) Reboot the server.


Please go through this and correct if I am wrong.

Regards
Niru


sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

hi

1) in the custom_vg_activation the Lines for the VG vg00 can be omitted.

2)this scenario is actually doing the following thing:

this will umount all the LVs of the VG except those LVs not belonging to the vg00 and deactivate otther VGs.

but this shall activate the VGs vg00 and those mentioned in the custom_vg_activate at the system boot, but shall not mount the FS for all other VGs as the Entries from the /etc/fstab have been removed.

Was this that was wished?

then this is OKay.

IF THE FOLLOWING IS REQUIRED:
after that if it is wished that the fileystems for the VGs is mounted then it can be done using the simple mounting scripts that shall mount the corresponding LVs from the VGs to correct mount points.

NOTE:
just note that the Earlier entries as made in the custom_vg_activateion has activated all the VGs mentioned in the custom_vg_activate with vg00 at the system boot only their LVs are not mounted as the entries for them in the /etc/fstab has been commented

Regards
Sujit
Shehan
Super Advisor

Re: Diactivating Voulme group

Hi Sujit

Please see below my comments

1) This is a mistake. As we use AUTO_VG_ACTIVATE=0; option, I believe we don't need to add vg00 again in the "custom_vg_activation". Anyway
I will remove vg00 from custom_vg_activation

2)
I am not going to comment all entries in the /etc/fstab.However I will comment few entries which are belong to unwanted VGs(for example- all entries will not be commented for vg00,vg01,vg02,vg03,vg04, but entries belong to vg05,vg06,vg07,vg08,vg09 will be commented in /etc/fstab.When the server is rebooting,all lvols are belong to vg00,vg01,vg02,vg03,vg04 will be mounting automaltically.Then we dodn't want any script or manually mount after server booted. Please correct If I am wrong.

3) Anyway if you already have any script us to mount lvol, please share with us. Then we can ready for that also.

Thanks
Nirukshitha
sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

Hi Nirukshita,

Not much idea on scripting, i must say sorry.

a simple script with the commands for the LVs individually can help the purpose.

mount /dev// -F vxfs -o largefiles, /


regards
Sujit
Shehan
Super Advisor

Re: Diactivating Voulme group

Hi Sujit

It is ok. Anyway if I comment unwanted VG's Logical volume from /etc/fstab, I believe everything will be ok.Please let me know your idea on that way.

Regards
Nirukshitha
sujit kumar singh
Honored Contributor

Re: Diactivating Voulme group

hi Nirukshita,

yes you can do that.


but once again note :

commenting other VG entries from /etc/fstab means that that filesystem shall not be mounted automatically as the system shall boot.
The entry of a VG in custom_vg_activation shall make that VG and the LV inside that available at the sytem boot.you can mount them automatically using entries in /etc/fstab or manually using the mount commands as and when you wish.

In ur approach the VG may get activated and may remain like that. You can any time mount the LVs from them as you decide .


Regards
Sujit
Shehan
Super Advisor

Re: Diactivating Voulme group

Dear Sumit

Thanks for the support. I will do as you said.

Regards
Nirukshitha