NOTE:
Striping with mirroring always uses strict allocation policies where copies of data
do not exist on the same physical disk. This results in a configuration similar to the RAID 01
as illustrated in
Figure 7 (page 158)
.
•
To create a logical volume of size 90MB striped across two physical volumes with one mirror
copy and stripe size of 64 KB and to create the mirror copies on specific disks ( configuration
equivalent to RAID 01 as illustrated in
Figure 7 (page 158)
, enter):
#lvcreate -L 90 -i 2 -I 64 /dev/vgtest
#lvextend -m 1 /dev/vgtest/lvol1 /dev/disk/disk3 /dev/disk/disk4
Contents of /etc/lvmpvg
VG /dev/vgtest
PVG PVG0
/dev/disk/disk1
/dev/disk/disk2
PVG PVG1
/dev/disk/disk3
/dev/disk/disk4
•
Adding a mirror to existing striped logical volumes.
The existing logical volume has the striped property as shown by the
lvdisplay
output:
# lvdisplay /dev/vgtest/lvol1
--- Logical volumes ---
LV Name /dev/vgtest/lvol1
VG Name /dev/vgtest
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule striped
LV Size (Mbytes) 1024
Current LE 256
Allocated PE 256
Stripes 2
Stripe Size (Kbytes) 64
Bad block on
Allocation strict
IO Timeout (Seconds) default
To get a striped and mirrored configuration, extend the logical volume as follows:
# lvextend -m 1 /dev/vgtest/lvol1
Note that the volume group must have enough physical volumes and extents to accommodate
the mirror copy.
Now the
lvdisplay
output shows the logical volume is striped and mirrored:
# lvdisplay /dev/vgtest/lvol1
--- Logical volumes ---
LV Name /dev/vgtest/lvol1
VG Name /dev/vgtest
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule striped
LV Size (Mbytes) 1024
Current LE 256
Allocated PE 256
Stripes 2
Stripe Size (Kbytes) 64
Bad block on
Allocation strict
IO Timeout (Seconds) default
LVM Striped and Mirrored Logical Volume Configuration
159