hpunix中lvmrc文件的配置
hpunix中lvmrc文件的配置_hpunix

有些 LVM Volume Group 不会在系统引导时激活。一旦系统被引导之后,这些 Volume Groups 可以从命令提示符下使用 vgchange 被激活,并且不会出现任何问题。

如何能够解决这个问题?

解决方法

这个问题的解决方法可能应用最新的 LVM 补丁程序即可。?如果 LVM 最新没有安装补丁程序,则请安装一个最新的 Quality Pack patch bundle 或者从 ITRC 下载并安装 LVM 补丁程序及其相关补丁。

如果应用补丁程序不能解决这个问题,则可以通过对 LVM Volume Group 的激活进程进行自定义来解决。

Volume group 激活是由 /sbin/lvmrc? Script 完成的。

/sbin/lvmrc 是由 /sbin/bcheckrc 调用的,后者会从/etc/inittab 中的下行内容运行:

brc1::bootwait:/sbin/bcheckrc      
/dev/console 2>&1 # fsck, etc.

/sbin/lvmrc 运行 vgchange 命令激活这些 VG 时,可能有些 disks/lun尚未准备好。

这个问题可以通过讒
远ㄒ?/etc/lvmrc 来自定义。请注意,更改是针对/etc/lvmrc 而不是针对 /sbin/lvmrc 的。

/etc/lvmrc 中存在一些指导,其中解释了如何对其进行自定义。

下面是一些必须的步骤。

  AUTO_VG_ACTIVATE 变量设置为 0:

AUTO_VG_ACTIVATE=0

接下来,自定义 custom_vg_acti?vation() 例程。添加一个 ioscan 命令来探询 vgchange 前面的所有设备,然后添加一个 parallel_vg_sync 来激活这些设备。例如,如果要激活vg00vg01 vg02:

custom_vg_activation()

{

     /sbin/ioscan -fn > /etc/ioscan.out

     /sbin/vgchange -a y -s

     parallel_vg_sync "/dev/vg00 /dev/vg01 /dev/vg02"

     return 0

}

 # /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=0

 

#

#       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.

"lvmrc" 84 lines, 1981 characters

# 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=0

#

#       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.

#

――――――――――hnzzrk02

custom_vg_activation()

{

        # e.g. /sbin/vgchange -a y -s

         /sbin/vgchange -a y -s

          parallel_vg_sync  "/dev/intevg01"

          parallel_vg_sync  "/dev/intevg02"

          parallel_vg_sync  "/dev/intevg03"

          parallel_vg_sync  "/dev/intevg04"

          parallel_vg_sync  "/dev/intevg05"

          parallel_vg_sync  "/dev/intevg06"

          parallel_vg_sync  "/dev/intevg07"

          parallel_vg_sync  "/dev/intevg08"

          parallel_vg_sync  "/dev/intevg09"

          parallel_vg_sync  "/dev/intevg10"

          parallel_vg_sync  "/dev/unibilvg01"

          parallel_vg_sync  "/dev/unibilvg02"

        #      parallel_vg_sync "/dev/vg00 /dev/vg01"

        #      parallel_vg_sync "/dev/vg02 /dev/vg03"

        return 0

}