Operating System - HP-UX
1748271 Members
4022 Online
108760 Solutions
New Discussion

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

 
Madhuchakaravar
Advisor

changing auto vg activate option to 0 from 1 in /etc/lvmrc

Hi

 

I don`t want external disk to activate ,only vg00 has to activate after rebooting the server.

 

so i am changing AUTO_VG_ACTIVATE=1  to AUTO_VG_ACTIVATE=0.

 

system is not in cluster.

 

by changing from 1 to 0, will VG00 activate or not.

--------------------------------------------------------------------------------------

 

$ cat /etc/lvmrc
# @(#)B.11.11_LR
# /etc/lvmrc
#
# This file is sourced by /sbin/lvmrc. This file contains the flags
# AUTO_VG_ACTIVATE and RESYNC which are required by the script in /sbin/lvmrc.
# These flags must be set to valid values (see below).
#

#
# The activation of Volume Groups may be customized by setting the
# AUTO_VG_ACTIVATE flag to 0 and customizing the function
# custom_vg_activation()
#

#
#       To disable automatic volume group activation,
#       set AUTO_VG_ACTIVATE to 0.
#

AUTO_VG_ACTIVATE=1

#
#       The variable RESYNC controls the order in which
#       Volume Groups are resyncronized. Allowed values
#       are:
#               "PARALLEL"      - resync all VGs at once.
#               "SERIAL"        - resync VGs one at a time.
#
#       SERIAL will take longer but will have less of an
#       impact on overall I/O performance.
#

RESYNC="SERIAL"


#
#       Add customized volume group activation here.
#       A function is available that will synchronize all
#       volume groups in a list in parallel. It is
#       called parallel_vg_sync.
#
#       This routine is only executed if AUTO_VG_ACTIVATE
#       equals 0.
#

custom_vg_activation()
{
        # e.g. /sbin/vgchange -a y -s
        #      parallel_vg_sync "/dev/vg00 /dev/vg01"
        #      parallel_vg_sync "/dev/vg02 /dev/vg03"

        return 0
}

#
# The following functions should require no additional customization:
#

parallel_vg_sync()
{
        for VG in $*
        do
                {
                if /sbin/vgsync $VG > /dev/null
                then
                        echo "Resynchronized volume group $VG"
                fi
                } &
        done
}

$

6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

You should add vg00 to the custom_vg_activation section of the /etc/lvmrcc file.

 

/sbin/vgchange -a y /dev/vg00

 

 

Madhuchakaravar
Advisor

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

HI

 

If i dont add /sbin/vgchange -a y vg00 ,,, will vgoo not activate after booting ???

RAJD1
Valued Contributor

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

Madhuchakaravar,

 

You have to make /etc/lvmrc so that none but vg00 activates after booting, as you don't want SAN vgs activation after system bootup.

For this /etc/lvmrc has to be customized with AUTO_VG_ACTIVATE=0  and add /dev/vg00 in custome vg activation function: Without it , it may not activate the vg00 .

 

custom_vg_activation()
{

       /sbin/vgchange -a y  /dev/vg00

       parallel_vg_sync " /dev/vg00 "
        # e.g. /sbin/vgchange -a y -s
        #      parallel_vg_sync "/dev/vg00 /dev/vg01"
        #      parallel_vg_sync "/dev/vg02 /dev/vg03"

        return 0
}

 

 

Hth,

Raj D.

Madhuchakaravar
Advisor

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

Hi Raj

 

You mean to say without adding vg00 to custom activation script,,vgoo will not be activated after reboot.

Patrick Wallek
Honored Contributor

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

Yes, that is correct.

 

Madhuchakaravar
Advisor

Re: changing auto vg activate option to 0 from 1 in /etc/lvmrc

hi

 

i checked with hp support,,they said vg00 will activate even if AUTO_VG_ACTIVATE=0, even when there is no entry in custom activation script