Operating System - HP-UX
1753974 Members
7116 Online
108811 Solutions
New Discussion юеВ

Diactivating Voulme group

 
SOLVED
Go to solution
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