HPlogo HP-UX Reference > V

vgchange(1M)

HP-UX 11i Version 2: December 2007 Update
» 

Technical documentation

 » Table of Contents

 » Index

NAME

vgchange — set LVM volume group availability

SYNOPSIS

Activate volume group

/usr/sbin/vgchange -a availability [-l] [-p] [-q quorum] [-s] [-P resync_daemon_count] [vg_name...]

Assign to high availability cluster and mark volume group sharable

/usr/sbin/vgchange -c cluster -S sharable vg_name

Change activation mode of sharable volume group

/usr/sbin/vgchange -a availability -x {vg_name...}

Remarks

MC/ServiceGuard cluster operations require the installation of the optional MC/ServiceGuard software, which is not included in the standard HP-UX operating system.

Mirrored disk operations require the installation of the optional HP MirrorDisk/UX software, which is not included in the standard HP-UX operating system.

DESCRIPTION

The vgchange command with the -a option activates or deactivates one or more volume groups.

When the -a option is used together with the -x option, the vgchange command allows cross-activation of a sharable volume group to the desired activation mode in a high availability cluster.

The vgchange command with the -c option controls the membership of one or more volume groups in a high availability cluster. The vgchange command with the -c and -S options control the membership of a volume group and mark it sharable.

The vgchange command without the -P resync_daemon_count option (default) will spawn one nomwcsyncd process for each NOMWC/NONE volume group being activated. This may create a lot of nomwcsyncd processes running concurrently when it activates a large number of NOMWC/NONE volume groups and overload.

The -P resync_daemon_count option provides a way to control the number of concurrent nomwcsyncd processes. The count is an advisory number and a different count might be chosen internally if load balance or other reason is needed. When specified, there are up to resync_daemon_count + 1 nomwcsyncd processes; one of them is the controlling processing to spawn others. -P 0 will use the system default (currently defined to be 4).

vg_name must be defined as a volume group in the file /etc/lvmtab. If vg_name is omitted, all volume groups defined in /etc/lvmtab are affected, when the -x option is not specified.

High Availability Cluster Overview

Volume groups can be defined on disk volumes that are accessible by more than one system in a high availability cluster. This situation has a high potential for data corruption unless higher level cluster software services are used to coordinate shared access to the same volume group by all systems.

A volume group can be marked as part of a cluster. When such a group is activated in exclusive mode, it can be accessed for exclusive read-write activity by only one of the systems at a time; the other systems can have read-only access to the data. When the volume group is marked as sharable, it may be activated in shared mode for read-write access by all the nodes in the cluster.

The configuration of a shared volume group can be changed only if it is activated in exclusive mode. Cross-activation between shared and exclusive modes of shared volume groups is possible with the -x option to vgchange.

Options and Arguments

vgchange recognizes the following options and arguments:

vg_name

The path name of a volume group.

-a availability

Set volume group availability. availability can have one of the following values:

y

Activate each specified volume group and all associated physical and logical volumes for read-write access. If a volume group is marked as part of a high availability cluster, it is activated in exclusive read-write mode, as for the -a e option.

e

Activate each specified volume group and all associated physical and logical volumes for exclusive read-write access. The volume group must be marked as part of a high availability cluster, and the availability software must be running on the system; otherwise, the volume group is not activated.

With the -x option, the activation mode of a shared volume group is changed to exclusive. The volume group will remain active during the operation. The operation will not be performed if the volume group is active in more than one node, or if it is not currently in shared mode.

s

Activate each specified volume group and all associated physical and logical volume for shared read-write access. The volume group must be marked as part of a high availability cluster and marked sharable; otherwise, the volume group is not activated.

Please note HP MirrorDisk/UX software is only supported in a clustered environment with a maximum of two nodes configured.

With the -x option, the activation mode of a shared volume group is changed to shared. The volume group will remain active during the operation. The operation will only be performed if the current activation mode of the volume group is exclusive.

If the -a y or -a e option is executed on a currently active volume group, without the -x option, vgchange attempts to include any physical volumes that were previously listed as missing. This is useful if a physical volume has come back online. However, no automatic synchronization of any mirrored logical volumes is done. If synchronization is required, execute the vgsync command (see vgsync(1M)).

r

Activate each specified volume group and all associated physical and logical volumes for read-only access. This option is ignored for a volume group that is already activated.

If a volume group is marked as part of a high availability cluster, the high availability software must be running on the system; otherwise, the volume group is not activated.

n

Deactivate each specified volume group and its associated logical volumes. You must close the logical volumes prior to executing this option. For example, if the logical volume contains a file system, the file system must be unmounted.

-c cluster

Control the membership of volume groups in a high availability cluster. cluster can have one of the following values:

y

Mark each specified volume group as a member of the high availability cluster. The high availability software must be running; otherwise, the volume group is not marked. Needs to be done on one node only.

n

Remove each specified volume group from membership in the high availability cluster. The high availability software does not need to be running.

The volume group must be deactivated with the -a n option before a -c y|n option can be executed.

-S sharable

Control the sharability of volume groups in a high availability cluster. sharable can have one of the following values:

y

Mark each specified volume group as sharable. The high availability software must be running; otherwise, the volume group is not marked. Needs to be done on one node only.

n

Remove the shared attribute from the volume group. The high availability software does not need to be running.

The volume group must be deactivated with the -a n option before a -S y|n option can be executed.

-l

Disable the opening of logical volumes that belong to each specified volume group. If the -l option is set, later attempts to open the logical volumes will fail. To allow an opening of these logical volumes to succeed, execute lvchange -a y.

-p

Activate each specified volume group only if all of the physical volumes that belong to it are available.

-q quorum

Set the quorum enforcement for each specified volume group. quorum can have one of the following values:

y

Enforce the quorum requirement. This is the default.

n

Ignore the quorum requirement.

The -q n option can be used to activate the volume group when the disk quorum is not maintained because too many disks were lost. Since it ensures the integrity of the LVM configuration information, it is normally not advisable to override the quorum.

-s

Disable the synchronization of stale physical extents within the volume group specified by vg_name. This option is only effective when used with the -a y or -a e option.

-x

Cross activate a shared volume group to a different activation mode. This option is only effective when used with the -a availability option.

-P resync_daemon_count

specify the advisory count to control the number of nomwcsyncd processes on volume group activation.

Mirrored Disk Activation

When the optional HP MirrorDisk/UX software is running and a volume group is activated, LVM performs the necessary mirror consistency recovery for each logical volume in the volume group based on the state of Mirror Write Cache and Mirror Consistency Recovery (see the Consistency Recovery section of lvdisplay(1M)). In a non-shared environment, LVM supports MWC, NOMWC and the NONE recovery. But in shared environment, LVM only supports NOMWC and the NONE recovery.

MWC

Recover mirror consistency by using the Mirror Write Cache and Mirror Consistency Record. This mode implies that the Mirror Write Cache is on.

NOMWC

Recover mirror consistency by searching all logical extents and copying data from a non-stale copy to the other mirror copies. This mode implies that the Mirror Write Cache is off.

NONE

Do not recover mirror consistency during volume group activation on this logical volume following a system crash. This mode implies that the Mirror Write Cache is off.

Next, mirror synchronization refreshes stale mirror copies by copying data from a nonstale copy. If the -s option is specified on the command line, mirror synchronization does not occur. However, for those logical volumes that have Mirror Write Cache turned off, mirror synchronization is done independently of whether the -s option appears on the command line.

General Activation

If vgchange cannot access a physical volume, it lists the volume's status as missing. If too many physical volumes in the volume group are missing, vgchange reports that the group does not have a quorum and cannot be activated. The lack of a quorum can be overridden with the -q n option.

EXTERNAL INFLUENCES

Environment Variables

LANG determines the language in which messages are displayed.

If LANG is not specified or is null, it defaults to "C" (see lang(5)).

If any internationalization variable contains an invalid setting, all internationalization variables default to "C" (see environ(5)).

EXAMPLES

Activate volume group /dev/vg03:

vgchange -a y /dev/vg03

Deactivate volume group /dev/vg03:

vgchange -a n /dev/vg03

Activate volume group /dev/vg03 without synchronizing extents that are not current on logical volumes that have Mirror Write Cache turned on:

vgchange -a y -s /dev/vg03

Exclusive Activation

Set up volume group /dev/vg03 for use in a high availability cluster:

vgchange -a n /dev/vg03 # Deactivate volume group vgchange -c y /dev/vg03 # Enable volume group for HA cluster vgchange -c y -S y /dev/vg03 # Enable volume group for HA cluster and mark as sharable vgchange -a e /dev/vg03 # Activate volume group in exclusive mode vgchange -a s /dev/vg03 # Activate volume group in shared mode

Activate all volume groups; activate those that are marked for membership in a high availability cluster in shared mode:

vgchange -a y

Activate all volumes that are marked for membership in a high availability cluster in exclusive mode:

vgchange -a e

Cross Activation

Set up volume group /dev/sh_vg for use in a high availability cluster.

To make configuration changes, to a volume group activated in shared mode, deactivate the volume group by executing the following command on each cluster node except one:

vgchange -a n sh_vg

On the single node, where the volume group is active:

  • vgchange -a e -x sh_vg # Change mode to exclusive

  • vgchange -a s -x sh_vg # After configuration change, change

    mode back to shared

WARNINGS

Ordinary Operation

In ordinary operation (that is, without the optional high availability software), it is possible to activate a volume group for read-write access from more than one physically connected system, leading to a high potential for data corruption. Therefore, if access is desired from more than one system to a single volume group, it is important that only one system activate the volume group for read-write access; the other systems can use read-only access. There is no problem if all systems activate the volume group for read-only access.

Furthermore, volume group information is only read from the disks during volume group activation. Dynamic changes to the volume group such as the following are not propagated to other systems sharing the volume group:

  • Logical volume configuration changes.

  • Changes to the status of the mirrored extents.

  • Bad-block relocation that occurs during write operations.

Because of these limitations, when sharing volume groups between systems, it is recommended that logical volumes be accessed only by one system at a time. If logical volumes must be accessed simultaneously, the logical volumes should not be mirrored and should not have bad-block relocation turned on, or all systems should use read-only access to the logical volumes.

In order to activate a logical volume greater than 2 terabytes, the kernel must be updated to support this feature, and the corresponding feature enabling patch must be installed.

In order to activate a striped and mirrored logical volume, the kernel must be updated to support this feature, and the corresponding feature enabling patch must be installed.

SEE ALSO

mount(1M), vgcreate(1M), vgextend(1M), vgreduce(1M), vgdisplay(1M).

If MC/ServiceGuard is installed: cmcheckconf(1M), cmquerycl(1M), and Managing MC/ServiceGuard.