3. Recovering from LVM Mirror Failure
This section provides an example of recovering from a situation where one leg of an LVM
mirrored volume fails because the underlying device for a physical volume goes down. When a
mirror leg fails, LVM converts the mirrored volume into a linear volume, which continues to
operate as before but without the mirrored redundancy. At that point, you can add a new disk
device to the system to use as a replacement physical device and rebuild the mirror.
The following command creates the physical volumes which will be used for the mirror.
[root@link-08 ~]# pvcreate /dev/sd[abcdefgh][12]
Physical volume "/dev/sda1" successfully created
Physical volume "/dev/sda2" successfully created
Physical volume "/dev/sdb1" successfully created
Physical volume "/dev/sdb2" successfully created
Physical volume "/dev/sdc1" successfully created
Physical volume "/dev/sdc2" successfully created
Physical volume "/dev/sdd1" successfully created
Physical volume "/dev/sdd2" successfully created
Physical volume "/dev/sde1" successfully created
Physical volume "/dev/sde2" successfully created
Physical volume "/dev/sdf1" successfully created
Physical volume "/dev/sdf2" successfully created
Physical volume "/dev/sdg1" successfully created
Physical volume "/dev/sdg2" successfully created
Physical volume "/dev/sdh1" successfully created
Physical volume "/dev/sdh2" successfully created
The following commands creates the volume group
vg
and the mirrored volume
groupfs
.
[root@link-08 ~]# vgcreate vg /dev/sd[abcdefgh][12]
Volume group "vg" successfully created
[root@link-08 ~]# lvcreate -L 750M -n groupfs -m 1 vg /dev/sda1 /dev/sdb1
/dev/sdc1
Rounding up size to full physical extent 752.00 MB
Logical volume "groupfs" created
You can use the
lvs
command to verify the layout of the mirrored volume and the underlying
devices for the mirror leg and the mirror log. Note that in the first example the mirror is not yet
completely synced; you should wait until the
Copy%
field displays 100.00 before continuing.
[root@link-08 ~]# lvs -a -o +devices
LV
VG
Attr
LSize
Origin Snap%
Move Log
Copy% Devices
groupfs
vg
mwi-a- 752.00M
groupfs_mlog
21.28 groupfs_mimage_0(0),groupfs_mimage_1(0)
[groupfs_mimage_0] vg
iwi-ao 752.00M
/dev/sda1(0)
[groupfs_mimage_1] vg
iwi-ao 752.00M
Recovering from LVM Mirror Failure
71
Содержание GLOBAL FILE SYSTEM 5.0
Страница 1: ...LVM Administrator s Guide Configuration and Administration 5 0 ISBN N A Publication date...
Страница 4: ...LVM Administrator s Guide...
Страница 8: ...viii...
Страница 18: ...6...
Страница 28: ...16...
Страница 32: ...20...
Страница 80: ...68...
Страница 90: ...78...
Страница 92: ...80...
Страница 94: ...82...
Страница 112: ...100...