Show Table of Contents
220.127.116.11. Extending a Mirrored Volume
As of the Red Hat Enterprise Linux 6.3 release, it is possible to grow mirrored logical volumes with the
lvextendcommand without performing a synchronization of the new mirror regions.
If you specify the
--nosyncoption when you create a mirrored logical volume with the
lvcreatecommand, the mirror regions are not synchronized when the mirror is created, as described in Section 5.4.3, “Creating Mirrored Volumes”. If you later extend a mirror that you have created with the
--nosyncoption, the mirror extensions are not synchronized at that time, either.
You can determine whether an existing logical volume was created with the
--nosyncoption by using the
lvscommand to display the volume's attributes. A logical volume will have an attribute bit 1 of "M" if it is a mirrored volume that was created without an initial synchronization, and it will have an attribute bit 1 of "m" if it was created with initial synchronization.
The following command displays the attributes of a mirrored logical volume named
lvthat was created without initial synchronization, showing attribute bit 1 as "M". Attribute bit 7 is "m", indicating a target type of
mirror. For information on the meaning of the attribute bits, see Table 5.4, “lvs Display Fields”.
lvs vgLV VG Attr LSize Pool Origin Snap% Move Log Copy% Convert lv vg Mwi-a-m- 5.00g lv_mlog 100.00
If you grow this mirrored logical volume with the
lvextendcommand, the mirror extension will not be resynchronized.
If you created a mirrored logical volume without specifying the
--nosyncoption of the
lvcreatecommand, you can grow the logical volume without resynchronizing the mirror by specifying the
--nosyncoption of the
The following example extends a logical volume that was created without the
--nosyncoption, indicated that the mirror was synchronized when it was created. This example, however, specifies that the mirror not be synchronized when the volume is extended. Note that the volume has an attribute of "m", but after executing the
lvextendcommmand with the
--nosyncoption the volume has an attribute of "M".
lvs vgLV VG Attr LSize Pool Origin Snap% Move Log Copy% Convert lv vg mwi-a-m- 20.00m lv_mlog 100.00 #
lvextend -L +5G vg/lv --nosyncExtending 2 mirror images. Extending logical volume lv to 5.02 GiB Logical volume lv successfully resized #
lvs vgLV VG Attr LSize Pool Origin Snap% Move Log Copy% Convert lv vg Mwi-a-m- 5.02g lv_mlog 100.00
If a mirror is inactive, it will not automatically skip synchronization when you extend the mirror, even if you create the mirror with the
--nosyncoption specified. Instead, you will be prompted whether to do a full resync of the extended portion of the logical volume.
If a mirror is performing recovery, you cannot extend the mirrored logical volume if you created or extended the volume with the
--nosyncoption specified. If you did not specify the
--nosyncoption, however, you can extend the mirror while it is recovering.