18.104.22.168. Extending a Mirrored Volume
As of the Red Hat Enterprise Linux 6.3 release, it is possible to grow mirrored logical volumes with the
lvextend command without performing a synchronization of the new mirror regions.
If you specify the
--nosync option when you create a mirrored logical volume with the
lvcreate command, 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
--nosync option, the mirror extensions are not synchronized at that time, either.
You can determine whether an existing logical volume was created with the
--nosync option by using the
lvs command 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
lv that 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”.
LV 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
lvextend command, the mirror extension will not be resynchronized.
If you created a mirrored logical volume without specifying the
--nosync option of the
lvcreate command, you can grow the logical volume without resynchronizing the mirror by specifying the
--nosync option of the
The following example extends a logical volume that was created without the
--nosync option, 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
lvextend commmand with the
--nosync option 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
--nosync option 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
--nosync option specified. If you did not specify the
--nosync option, however, you can extend the mirror while it is recovering.