Installation guide

Chapter 4. LVM Administration with CLI Commands
38
By default, the mirror_image_fault_policy parameter is set to remove. With this policy, if a
mirror image fails the mirror will convert to a non-mirrored device if there is only one remaining good
copy. Setting this policy to allocate for a mirror device requires the mirror to resynchronize the
devices; this is a slow process, but it preserves the mirror characteristic of the device.
Note
When an LVM mirror suffers a device failure, a two-stage recovery takes place. The first stage
involves removing the failed devices. This can result in the mirror being reduced to a linear
device. The second stage, if the mirror_log_fault_policy parameter is set to allocate,
is to attempt to replace any of the failed devices. Note, however, that there is no guarantee that
the second stage will choose devices previously in-use by the mirror that had not been part of the
failure if others are available.
For information on manually recovering from an LVM mirror failure, refer to Section 6.3,
“Recovering from LVM Mirror Failure”.
4.4.3.2. Splitting Off a Redundant Image of a Mirrored Logical Volume
You can split off a redundant image of a mirrored logical volume to form a new logical volume. To
split off an image, you use the --splitmirrors argument of the lvconvert command, specifying
the number of redundant images to split off. You must use the --name argument of the command to
specify a name for the newly-split-off logical volume.
The following command splits off a new logical volume named copy from the mirrored logical volume
vg/lv. The new logical volume contains two mirror legs. In this example, LVM selects which devices
to split off.
# lvconvert --splitmirrors 2 --name copy vg/lv
You can specify which devices to split off. The following command splits off a new logical volume
named copy from the mirrored logical volume vg/lv. The new logical volume contains two mirror
legs consisting of devices /dev/sdc1 and /dev/sde1.
# lvconvert --splitmirrors 2 --name copy vg/lv /dev/sd[ce]1
4.4.3.3. Repairing a Mirrored Logical Device
You can use the lvconvert --repair command to repair a mirror after a disk failure. This brings
the mirror back into a consistent state. The lvconvert --repair command is an interactive
command that prompts you to indicate whether you want the system to attempt to replace any failed
devices.
To skip the prompts and replace all of the failed devices, specify the -y option on the command line.
To skip the prompts and replace none of the failed devices, specify the -f option on the command
line.
To skip the prompts and still indicate different replacement policies for the mirror image and the
mirror log, you can specify the --use-policies argument to use the device replacement policies