Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Manual page 47

Hide thumbs Also See for ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION:
Table of Contents

Advertisement

lvcreate -L 500M -m1 -n mirrorlv vg0 /dev/sda1 /dev/sdb1 /dev/sdc1
The following command creates a mirrored logical volume with a single mirror. The volume is 500
megabytes in size, it is named mirrorlv, and it is carved out of volume group vg0. The first leg
of the mirror is on extents 0 through 499 of device /dev/sda1, the second leg of the mirror is on
extents 0 through 499 of device /dev/sdb1, and the mirror log starts on extent 0 of device /dev/
sdc1. These are 1MB extents. If any of the specified extents have already been allocated, they will be
ignored.
lvcreate -L 500M -m1 -n mirrorlv vg0 /dev/sda1:0-499 /dev/sdb1:0-499 /dev/
sdc1:0
Note
As of the RHEL 5.3 release, mirrored logical volumes are supported in a cluster. Creating
a mirrored LVM logical volume in a cluster requires the same commands and procedures
as creating a mirrored LVM logical volume on a single node. However, in order to create
a mirrored LVM volume in a cluster the cluster and cluster mirror infrastructure must be
running, the cluster must be quorate, and the locking type in the lvm.conf file must be
set correctly to enable cluster locking. For an example of creating a mirrored volume in a
cluster, see
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
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
Section 5.5, "Creating a Mirrored LVM Logical Volume in a
Creating Logical Volumes
Cluster".
Section 6.3, "Recovering from LVM
35

Advertisement

Table of Contents
loading

Table of Contents