Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR Manual page 74

Cluster logical volume manager
Table of Contents

Advertisement

Chapter 5. LVM Configuration Examples
4. Start the cmirror service.
[root@doc-07 ~]# service cmirror start
Loading clustered mirror log:
5. Create the mirror. The first step is creating the physical volumes. The following commands create
three physical volumes. Two of the physical volumes will be used for the legs of the mirror, and the
third physical volume will contain the mirror log.
[root@doc-07 ~]# pvcreate /dev/xvdb1
Physical volume "/dev/xvdb1" successfully created
[root@doc-07 ~]# pvcreate /dev/xvdb2
Physical volume "/dev/xvdb2" successfully created
[root@doc-07 ~]# pvcreate /dev/xvdc1
Physical volume "/dev/xvdc1" successfully created
6. Create the volume group. This example creates a volume group mirrorvg that consists of the
three physical volumes that were created in the previous step.
[root@doc-07 ~]# vgcreate mirrorvg /dev/xvdb1 /dev/xvdb2 /dev/xvdc1
Clustered volume group "mirrorvg" successfully created
Note that the output of the vgcreate command indicates that the volume group is clustered. You
can verify that a volume group is clustered with the vgs command, which will show the volume
group's attributes. If a volume group is clustered, it will show a c attribute.
[root@doc-07 ~]# vgs mirrorvg
VG
#PV #LV #SN Attr
mirrorvg
3
7. Create the mirrored logical volume. This example creates the logical volume mirrorlv from the
volume group mirrorvg. This volume has one mirror leg. This example specifies which extents of
the physical volume will be used for the logical volume.
[root@doc-07 ~]# lvcreate -l 1000 -m1 mirrorvg -n mirrorlv /dev/
xvdb1:1-1000 /dev/xvdb2:1-1000 /dev/xvdc1:0
Logical volume "mirrorlv" created
You can use the lvs command to display the progress of the mirror creation. The following
example shows that the mirror is 47% synced, then 91% synced, then 100% synced when the
mirror is complete.
62
VSize
0
0 wz--nc 68.97G 68.97G
VFree
[
OK
]

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents