4.4.1.4. Changing Mirrored Volume Configuration

4.4.1.4. Changing Mirrored Volume Configuration

You can convert a logical volume from a mirrored volume to a linear volume or from a linear volume to a mirrored volume with the lvconvert command. You can also use this command to reconfigure other mirror parameters of an existing logical volume, such as corelog.

When you convert a logical volume to a mirrored volume, you are basically creating mirror legs for an existing volume. This means that your volume group must contain the devices and space for the mirror legs and for the mirror log.

If you lose a leg of a mirror, LVM converts the volume to a linear volume so that you still have access to the volume, without the mirror redundancy. After you replace the leg, you can use the lvconvert command to restore the mirror. This procedure is provided in Section 6.3, “Recovering from LVM Mirror Failure”.

The following command converts the linear logical volume vg00/lvol1 to a mirrored logical volume.

lvconvert -m1 vg00/lvol1

The following command converts the mirrored logical volume vg00/lvol1 to a linear logical volume, removing the mirror leg.

lvconvert -m0 vg00/lvol1

Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.