Mirrors all the logical volumes that exist on a given volume group. This command only applies to AIX 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.
Note: 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 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.
-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:
mirrorvg -c 3 workvg
The logical partitions in the logical volumes held on workvg now have three copies.
mirrorvg rootvg
rootvg now has two copies.
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.
mirrorvg -S -c 3 workvg
mirrorvg -m datavg hdisk2 hdisk3
/usr/sbin | Directory where the mirrorvg command resides. |
The mklvcopy command, unmirrorvg command, syncvg command, extendvg command, reducevg command, sysdumpdev command.
For information on installing the Web-based System Manager, see Chapter 2: Installation and System Requirements in AIX 5L Version 5.1 Web-based System Manager Administration Guide.
The Logical Volume Storage Overview in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices.