unmirrorvg Command
Purpose
Removes the mirrors that exist on volume groups or specified disks.
Syntax
unmirrorvg [ -c Copies ] [ -p mirrorpool] VolumeGroup [PhysicalVolume...]
Description
The unmirrorvg command unmirrors all the logical volumes detected on a given volume group. This same functionality may also be accomplished manually if you execute the rmlvcopy command for each individual logical volume in a volume group.
By default, unmirrorvg will pick the set of mirrors to remove from a mirrored volume group. If you wish to control which drives no longer are to contain mirrors, you must include the list of disks in the input parameters, PhysicalVolume.
- If LVM has not recognized that a disk has failed it is possible that LVM will remove a different mirror. Therefore if you know that a disk has failed and LVM does not show those disks as missing you should specify the failed disks on the command line or you should use replacepv to replace the disk or reducevg to remove the disk.
- If a logical volume copy spans more than one disk, the portion of the logical volume copy that resides on a disk not listed by the user is also removed.
- The unmirrorvg command is not allowed on a snapshot volume group.
- Using a PhysicalVolume list with the -c 1 option (the default) will cause affected triply-mirrored logical volumes to have two copies removed. Only one of these copies will be related to the listed physical volumes. This is because the physical volume list is used to determine affected logical volumes, which are then reduced to the specified number of copies. In this case, the second copy to remove is selected by unmirrorvg
- When a corresponding hard disk and /dev/ipldevice are removed then a reboot is required.
- If you are removing the first mirror pool copy by specifying the disks in the
first copy to remove, you might also want to move your logical volumes mirror pool assignments by
running the chlv command. For
example:
chlv -m copy1=poolb -M 2 lv00
You can use the System Management Interface Tool (SMIT) to run this command. To use SMIT, enter:
smit unmirrorvg
Flags
Item | Description |
---|---|
-c Copies | Specifies the minimum number of copies that each logical volume must have after the unmirrorvg command has finished executing. If you do not want all logical volumes to have the same number of copies, then reduce the mirrors manually with the rmlvcopy command. If this option is not used, the copies will default to 1. |
-p mirrorpool | Removes the copy that exists on specified mirror pools. To remove more than one copy, provide multiple [-p mirrorpool] flags. |
The following is a description of rootvg:
Item | Description |
---|---|
rootvg unmirroring | When the rootvg unmirroring has completed, you must
perform two additional tasks: bosboot and bootlist. The bosboot command is required to reinitialize the boot record on the remaining disk. The bootlist command needs to be performed so that the system will only boot to the disk left in rootvg. |
Examples
- To unmirror a triply mirrored volume group and leave two copies,
enter:
The logical partitions in the logical volumes held on workvg now have 2 copies.unmirrorvg -c 2 workvg
- To get default unmirroring of rootvg, enter:
rootvg now has only 1 copy.unmirrorvg rootvg
- 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. This follows the default behavior of unmirrorvg to reduce the mirror copy count to 1.Note: When unmirrorvg workvg hdisk7 is run, hdisk7 will be the remaining drive in the volume group. This drive is not actually removed from the volume group. You must run the migratepv command to move the data from the disk that is to be removed from the system to disk hdisk7.
Files
Item | Description |
---|---|
/usr/sbin | Directory where the unmirrorvg command resides. |