mirrorvg Command

Purpose

Mirrors all the logical volumes that exist on a given volume group.

Syntax

mirrorvg [ -S | -s ] [ -Q ] [ -c copies] [ -m ] [ -p copyn=mirrorpool ] volumegroup [ physicalvolume ... ]

Description

The mirrorvg command takes all the logical volumes on a given volume group and mirrors those logical volumes. This same functionality may also be accomplished manually if you execute the mklvcopy command for each individual logical volume in a volume group. As with mklvcopy, the target physical drives to be mirrored with data must already be members of the volume group. To add disks to a volume group, run the extendvg command.

By default, mirrorvg attempts to mirror the logical volumes onto any of the disks in a volume group. If you wish to control which drives are used for mirroring, you must include the list of disks in the input parameters, physicalvolume. Mirror strictness is enforced. Additionally, mirrorvg mirrors the logical volumes, using the default settings of the logical volume being mirrored. If you wish to violate mirror strictness or affect the policy by which the mirror is created, you must execute the mirroring of all logical volumes manually with the mklvcopy command.

When mirrorvg is executed, the default behavior of the command requires that the synchronization of the mirrors must complete before the command returns to the user. If you wish to avoid the delay, use the -S or -s option. Additionally, the default value of 2 copies is always used. To specify a value other than 2, use the -c option.

Restrictions:
  • To use this command, you must either have root user authority or be a member of the system group.
  • You cannot use the mirrorvg command on a snapshot volume group.
  • You cannot use the mirrorvg command on a volume group that has an active firmware assisted dump logical volume.
Attention: The mirrorvg command may take a significant amount of time before completing because of complex error checking, the amount of logical volumes to mirror in a volume group, and the time is takes to synchronize the new mirrored logical volumes.

You can use the Volumes application in Web-based System Manager (wsm) to change volume characteristics. You could also use the System Management Interface Tool (SMIT) smit mirrorvg fast path to run this command.

See the section "Administering a PowerHA® cluster" in the PowerHA SystemMirror Administration Guide, 7.1 or later, for a discussion of the behavior of this command in a PowerHA cluster.

Flags

Item Description
-c copies Specifies the minimum number of copies that each logical volume must have after the mirrorvg command has finished executing. It may be possible, through the independent use of mklvcopy, that some logical volumes may have more than the minimum number specified after the mirrorvg command has executed. Minimum value is 2 and 3 is the maximum value. A value of 1 is ignored.
-m exact map Allows mirroring of logical volumes in the exact physical partition order that the original copy is ordered. This option requires you to specify a PhysicalVolume(s) where the exact map copy should be placed. If the space is insufficient for an exact mapping, then the command will fail. You should add new drives or pick a different set of drives that will satisfy an exact logical volume mapping of the entire volume group. The designated disks must be equal to or exceed the size of the drives which are to be exactly mirrored, regardless of if the entire disk is used. Also, if any logical volume to be mirrored is already mirrored, this command will fail.
-p copyn=mirrorpool Assigns mirror pools to the copies being created. A mirror pool is assigned to a copy using the copyn=mirrorpool parameter. Specify a mirror pool for each copy. To specify more than one copyn=mirrorpool pair, provide multiple -p copyn=mirrorpool flags.
-Q Quorum Keep By default in mirrorvg, when a volume group's contents becomes mirrored, volume group quorum is disabled. If the user wishes to keep the volume group quorum requirement after mirroring is complete, this option should be used in the command. For later quorum changes, refer to the chvg command.
-S Background Sync Returns the mirrorvg command immediately and starts a background syncvg of the volume group. With this option, it is not obvious when the mirrors have completely finished their synchronization. However, as portions of the mirrors become synchronized, they are immediately used by the operating system in mirror usage.
-s Disable Sync Returns the mirrorvg command immediately without performing any type of mirror synchronization. If this option is used, the mirror may exist for a logical volume but is not used by the operating system until it has been synchronized with the syncvg command.

The following is a description of rootvg:

Item Description
rootvg mirroring When the rootvg mirroring has completed, you must perform two additional tasks: bosboot and bootlist.

The bosboot command is required to customize the bootrec of the newly mirrored drive. The bootlist command needs to be performed to instruct the system which disk and order you prefer the mirrored boot process to start.

non-rootvg mirroring When this volume group has been mirrored, the default command causes Quorum to be deactivated.
rootvg and non-rootvg mirroring The system dump devices, primary and secondary, should not be mirrored. In some systems, the paging device and the dump device are the same device. However, most users want the paging device mirrored. When mirrorvg detects that a dump device and the paging device are the same, the logical volume will be mirrored automatically.

If mirrorvg detects that the dump and paging device are different logical volumes, the paging device is automatically mirrored, but the dump logical volume is not. The dump device can be queried and modified with the sysdumpdev command.

Security

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 AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To triply mirror a volume group, enter:
    mirrorvg -c 3 workvg
    The logical partitions in the logical volumes held on workvg now have three copies.
  2. To get default mirroring of rootvg, enter:
    mirrorvg rootvg
    rootvg now has two copies.
  3. To replace a bad disk drive in a mirrored volume group, enter
    unmirrorvg workvg hdisk7
    reducevg workvg hdisk7
    rmdev -l hdisk7 -d
    replace the disk drive, let the drive be renamed hdisk7
    extendvg workvg hdisk7
    mirrorvg workvg
    Note: By default in this example, mirrorvg will try to create 2 copies for logical volumes in workvg. It will try to create the new mirrors onto the replaced disk drive. However, if the original system had been triply mirrored, there may be no new mirrors created onto hdisk7, as other copies may already exist for the logical volumes.
  4. To sync the newly created mirrors in the background, enter:
    mirrorvg -S -c 3 workvg
  5. To create a second and third copy of the logical volumes within datavg, where the physical partition maps on each disk match each other exactly, enter:
    mirrorvg -m -c 3 datavg hdisk2 hdisk3
    The logical partitions in the logical volumes held on datavg now have three copies.

Files

Item Description
/usr/sbin Directory where the mirrorvg command resides.