varyonvg Command


Activates a volume group.


varyonvg [ -b ] [ -c ] [ -f ] [ -M ltgsize ] [ -n ] [ -p ] [ -r ] [ -s ] [ -t ] [ -u ] [ -k loc|rem ] [ -d ] [ -o ] [ -O ] volumegroup


The varyonvg command activates the volume group specified by the volumegroup parameter and all associated logical volumes. A volume group that is activated is available for use. When a volume group is activated, physical partitions are synchronized if they are not current. Physical volumes that are in the PVMISSING state and that have been replaced will be returned to the PVACTIVE state by the varyonvg command.

Note: If a physical volume is part of a dump device, the varyonvg command cannot return it to the PVACTIVE state. To run the command effectively, temporarily change the dump device.

A list of all physical volumes with their status is displayed to standard output whenever there is some discrepancy between the Device Configuration Database and the information stored in the Logical Volume Manager (LVM). The volume group may or may not be varied on. You must carefully examine the list and take proper action depending on each reported status to preserve your system integrity.

While varying on in concurrent mode, if the varyon process detects that there are logical volumes which are not previously known to the system, their definitions are imported. The permissions and ownership of the new device special files are duplicated to those of the volume group special file. If you have changed the permissions and/or ownership of the device special files of the logical volume on the node it was created, you will need to perform the same changes on this node.

Restriction: Classic Concurrent mode is not supported in AIX® 5.3.

If the volume group cannot be varied on due to a loss of the majority of physical volumes, a list of all physical volumes with their status is displayed. To vary on the volume group in this situation, you will need to use the force option.

The varyonvg command fails to vary on the volume group if a majority of the physical volumes are not accessible (no Quorum). This condition is true even if the quorum checking is disabled. Disabling the quorum checking will only ensure that the volume group stays varied on even in the case of loss of quorum.

The volume group will not vary on if any physical volumes are in the PV_MISSING state and the quorum checking is disabled. This condition is true even if a quorum of disks are available. To vary on in this situation either use the force option or set an environment variable MISSINGPV_VARYON to TRUE (set this value in /etc/environment if the volume group needs to be varied with missing disks at the boot time).

In the above cases (using the force vary on option and using the MISSINGPV_VARYON variable), you take full responsibility for the volume group integrity.

When you vary on a volume group that contains an encrypted logical volume, the varyonvg command attempts to unlock the encrypted logical volume. If the logical volume is configured with automated key protection methods, such as Platform keystore (PKS) or key server encryption methods, the varyonvg command communicates with the hdcryptmgr command to unlock the encrypted logical volume. If the unlock operation is successful, the logical volume is ready for I/O operations. Otherwise, any I/O requests to the encrypted logical volume is blocked and an error code of EACCES is returned. If a volume group contains an encrypted logical volume that is not configured with any automated key protection methods, the logical volume is blocked for any I/O operations until the unlock operation is performed successfully.

Requirement: To use this command, you must either have root user authority or be a member of the system group.

You could also use the System Management Interface Tool (SMIT) smit varyonvg fast path to run this command.


Item Description
-b Breaks disk reservations on disks locked as a result of a normal varyonvg command. Use this flag on a volume group that is already varied on.
  • This flag unlocks all disks in a given volume group.
  • The -b flag opens the disks in the volume group using SC_FORCED_OPEN flag. For SCSI and FC disks this forces open all LUNS on the target address that this disk resides on. Volume groups should therefore not share target addresses when using the varyon -b option.
  • The -b flag can cause a system to hang if used on a volume group that contains an active paging space.
-c Varies the volume group on Enhanced Concurrent mode. This is only possible if the volume group is Concurrent Capable or Enhanced Concurrent Capable and the system has the PowerHA® SystemMirror® product loaded and available. If neither is true, the volume group fails the varyon operation.
Requirement: Enhanced Concurrent volume groups use Group Services. Group Services must be configured prior to activating a volume group in this mode.
-d Allows data divergence. The -d flag only takes effect when you try to bring the volume group online while the cache at the opposite site might contain nonmirrored data updates and that cache is not accessible. If the varyonvg command detects that you might use back-level data and you do not specify the -d flag, the command fails with a meaningful error message.

For more information about asynchronous mirroring of geographic LVM, see Geographic Logical Volume Manager for PowerHA SystemMirror Enterprise Edition.

-f Allows a volume group to be made active that does not currently have a quorum of available disks. All disks that cannot be brought to an active state will be put in a removed state. At least one disk must be available for use in the volume group. The -f flag (used to override quorum loss) is ignored if the volume group has not lost quorum. If a disk is put into removed state, use the chpv -v a PVname command to bring the disk back to active state.
-k loc | rem Keeps data from the local mirror copy or remote mirror copy. You can specify the following attributes with the -k flag:
Retains the local mirror copy data. Local means local physical volumes and not primary site
Retains the remote mirror copy data. Remote means remote physical volumes and not remote site.

For more information about asynchronous mirroring of geographic LVM, see Geographic Logical Volume Manager for PowerHA SystemMirror Enterprise Edition.

-M ltgsize Statically sets the ltgsize of the volume group. Valid values for ltgsize include 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, and 128M. If any disk in the volume group is not configured with a maximum transfer of ltgsize or greater, the varyonvg command will fail.
-n Disables the synchronization of the stale physical partitions within the volumegroup parameter.
-o Allows using data from partitions that are stale in the copy you selected but fresh in the other copy. The varyonvg command fails if you specify the -k flag to preserve either local copy or remote copy in the data divergence case and the varyonvg command cannot preserve the complete copy because some partitions are not fresh in the local or remote copy that you selected. You can override the failure by specifying the -o flag to use data from partitions that are stale in the copy that you selected but fresh in the other copy. The -o flag is only valid with the -k flag.

For more information about asynchronous mirroring of geographic LVM, see Geographic Logical Volume Manager for PowerHA SystemMirror Enterprise Edition.

-p All physical volumes must be available to use the varyonvg command.
-r Varies on the volume group in read-only mode. This mode prevents:
  • Write operations to logical volumes
  • LVM metadata updates
  • Stale partitions synchronization
Restriction: Mounting a JFS file system on a read-only logical volume is not supported.
Restriction: All LVM high-level commands that require the LVM metadata update will fail the request in this mode.
-s Makes the volume group available in System Management mode only. Logical volume commands can operate on the volume group, but no logical volumes can be opened for input or output.
Restriction: Logical volume commands also cannot read or write to or from logical volumes in a volume group varied on with the -s flag. Logical volumes that attempt to write to a logical volume in a volume group varied on with the -s flag (such as chvg or mklvcopy) may display error messages indicating that they were unable to write to and/or read from the logical volume.
-t Checks the timestamps in the Device Configuration Database and the Logical Volume Manager. If there is a discrepancy in the timestamps, the synclvodm command is issued to synchronize the database.
Tip: This check is always done if the Volume Group is varied on in concurrent mode.
-u Varies on a volume group, but leaves the disks that make up the volume group in an unlocked state. Use this flag as part of the initial varyon operation of a dormant volume group.
-O Force a varyon operation of the volume group even if it is varied on in some other node.
Note: In AIX 61 TL8 and later releases, if the volume group created is not allowed to varyon in non-concurrent mode in more than one node then the varyonvg command updates LVM metadata and ODM with the varyon state of the volume group. During varyon time, the varyonvg command reads this data and fails if the volume group is already varied on in another node. The varyoffvg command will reset the varyon state of the volume group during the varyoff time. If the system crashes before varying off the volume group or the volume group is forced off, the varyonvg command fails after you reboot the system. In this scenario, use –O flag to force a varyon operation of the volume group.
Attention: The base design of LVM assumes that only one initiator can access a volume group. The PowerHA SystemMirror product does work with LVM in order to synchronize multi-node accesses of a shared volume group. However, multi-initiator nodes can easily access a volume group with the -b and -u flags without the use of PowerHA SystemMirror. You must be aware that volume group status information might be compromised or inexplicably altered as a result of disk protect (locking) being bypassed with these two flags. If you use the -b and -u flags, data and status output cannot be guaranteed to be consistent.

Exit Status

This command returns the following exit values:
Item Description
0 Successful completion.
>0 An error occurred.


Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.


  1. To activate volume group vg03, enter:
    varyonvg vg03
  2. To activate volume group vg03 without synchronizing partitions that are not current, enter:
    varyonvg -n vg03


Item Description
/usr/sbin Contains the varyonvg command directory.
/tmp Stores the temporary files while the command is running.