2
# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
4
# This copyrighted material is made available to anyone wishing to use,
5
# modify, copy, or redistribute it subject to the terms and conditions
6
# of the GNU General Public License v.2.
8
# You should have received a copy of the GNU General Public License
9
# along with this program; if not, write to the Free Software Foundation,
10
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
vgcreate -c n $vg $(cat DEVICES)
20
aux lvmconf 'allocation/maximise_cling = 0'
21
aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'
23
# fail multiple devices
25
# 4-way, disk log => 2-way, disk log
27
lvcreate -m 3 --ig -L 1 -n 4way $vg $dev1 $dev2 $dev3 $dev4 $dev5:0
28
aux disable_dev $dev2 $dev4
29
echo n | lvconvert --repair $vg/4way 2>&1 | tee 4way.out
30
lvs -a -o +devices | not grep unknown
31
vgreduce --removemissing $vg
32
aux enable_dev $dev2 $dev4
33
check mirror $vg 4way $dev5
35
# 3-way, disk log => linear
37
lvcreate -m 2 --ig -L 1 -n 3way $vg
38
aux disable_dev $dev1 $dev2
39
echo n | lvconvert --repair $vg/3way
41
lvs -a -o +devices | not grep unknown
42
lvs -a -o +devices | not grep mlog
43
dmsetup ls | grep $PREFIX | not grep mlog
44
vgreduce --removemissing $vg
45
aux enable_dev $dev1 $dev2
48
# fail just log and get it removed
50
# 3-way, disk log => 3-way, core log
52
lvcreate -m 2 --ig -L 1 -n 3way $vg $dev1 $dev2 $dev3 $dev4:0
54
echo n | lvconvert --repair $vg/3way
55
check mirror $vg 3way core
56
lvs -a -o +devices | not grep unknown
57
lvs -a -o +devices | not grep mlog
58
dmsetup ls | grep $PREFIX | not grep mlog
59
vgreduce --removemissing $vg
62
# 3-way, mirrored log => 3-way, core log
64
lvcreate -m 2 --mirrorlog mirrored --ig -L 1 -n 3way $vg \
65
$dev1 $dev2 $dev3 $dev4:0 $dev5:0
66
aux disable_dev $dev4 $dev5
67
echo n | lvconvert --repair $vg/3way
68
check mirror $vg 3way core
69
lvs -a -o +devices | not grep unknown
70
lvs -a -o +devices | not grep mlog
71
dmsetup ls | grep $PREFIX | not grep mlog
72
vgreduce --removemissing $vg
73
aux enable_dev $dev4 $dev5
75
# 2-way, disk log => 2-way, core log
77
lvcreate -m 1 --ig -L 1 -n 2way $vg $dev1 $dev2 $dev3:0
79
echo n | lvconvert --repair $vg/2way
80
check mirror $vg 2way core
81
lvs -a -o +devices | not grep unknown
82
lvs -a -o +devices | not grep mlog
83
vgreduce --removemissing $vg
91
lvcreate -m 1 --ig -L 1 -n mirror $vg
92
lvchange -a n $vg/mirror
95
lvchange --partial -a y $vg/mirror
97
not vgreduce -v --removemissing $vg
98
lvconvert -y --repair $vg/mirror
99
vgreduce --removemissing $vg
103
aux disable_dev $dev2
104
lvconvert -y --repair $vg/mirror
105
vgreduce --removemissing $vg
109
aux disable_dev $dev3
110
lvconvert -y --repair $vg/mirror
111
vgreduce --removemissing $vg