[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

mirrorvg Command


Mirrors all the logical volumes that exist on a given volume group. This command only applies to AIX Version 4.2.1 or later.


mirrorvg -S  -s ] [ -Q ] [ -c Copies] [ -m  ] VolumeGroup PhysicalVolume ... ]


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.

  1. This command ignores striped logical volumes. Mirroring striped logical volumes is not possible.
  2. To use this command, you must either have root user authority or be a member of the system group.
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 Web-based System Manager Volumes application (wsm lvm fast path) to run this command. You could also use the System Management Interface Tool (SMIT) smit mirrorvg fast path to run this command.


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

rootvg mirroring When the rootvg mirroring has completed, you must perform three additional tasks: bosboot, bootlist, and reboot.

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.

Finally, the default of this command is for Quorum to be turned off. For this to take effect on a rootvg volume group, the system must be rebooted.

non-rootvg mirroring When this volume group has been mirrored, the default command causes Quorum to deactivated. The user must close all open logical volumes, execute varyoffvg and then varyonvg on the volume group for the system to understand that quorum is or is not needed for the volume group. If you do not revaryon the volume group, mirror will still work correctly. However, any quorum changes will not have taken effect.
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.


  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 an exact mapped volume group, enter:
    mirrorvg -m datavg hdisk2 hdisk3

Implementation Specifics

Software Product/Option: Base Operating System/ AIX 3.2 to 4.1 Compatibility Links
Standards Compliance: NONE


/usr/sbin Directory where the mirrorvg command resides.

Related Information

The mklvcopy command, unmirrorvg command, syncvg command, extendvg command, reducevg command, sysdumpdev command.

Setting up and running Web-based System Management in AIX Version 4.3 System Management Guide: Operating System and Devices.

The Logical Volume Storage Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.

[ Previous | Next | Contents | Glossary | Home | Search ]