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
19 pvcreate
-M$mdatype $dev1 $dev2
21 # (lvm$mdatype) vgreduce removes only the specified pv from vg (bz427382)" '
22 vgcreate
-M$mdatype $vg1 $dev1 $dev2
24 check_pv_field_
$dev2 vg_name
$vg1
27 # (lvm$mdatype) vgreduce rejects removing the last pv (--all)
28 vgcreate
-M$mdatype $vg1 $dev1 $dev2
29 not vgreduce
--all $vg1
32 # (lvm$mdatype) vgreduce rejects removing the last pv
33 vgcreate
-M$mdatype $vg1 $dev1 $dev2
34 not vgreduce
$vg1 $dev1 $dev2
37 pvremove
-ff $dev1 $dev2
40 mdatype
=2 # we only expect the following to work for lvm2 metadata
42 # (lvm$mdatype) setup PVs (--metadatacopies 0)
43 pvcreate
-M$mdatype $dev1 $dev2
44 pvcreate
--metadatacopies 0 -M$mdatype $dev3 $dev4
46 # (lvm$mdatype) vgreduce rejects removing pv with the last mda copy (bz247448)
47 vgcreate
-M$mdatype $vg1 $dev1 $dev3
48 not vgreduce
$vg1 $dev1
51 #COMM "(lvm$mdatype) vgreduce --removemissing --force repares to linear (bz221921)"
52 # (lvm$mdatype) setup: create mirror & damage one pv
53 vgcreate
-M$mdatype $vg1 $dev1 $dev2 $dev3
54 lvcreate
-n $lv1 -m1 -l 4 $vg1
55 lvcreate
-n $lv2 -l 4 $vg1 $dev2
56 lvcreate
-n $lv3 -l 4 $vg1 $dev3
59 # (lvm$mdatype) vgreduce --removemissing --force repares to linear
60 vgreduce
--removemissing --force $vg1
61 check_lv_field_
$vg1/$lv1 segtype linear
62 vg_validate_pvlv_counts_
$vg1 2 3 0
67 #COMM "vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too"
68 # (lvm$mdatype) setup: create mirror + linear lvs
69 vgcreate
-M$mdatype $vg1 $devs
70 lvcreate
-n $lv2 -l 4 $vg1
71 lvcreate
-m1 -n $lv1 -l 4 $vg1 $dev1 $dev2 $dev3
72 lvcreate
-n $lv3 -l 4 $vg1 $dev3
73 pvs
--segments -o +lv_name
# for record only
74 # (lvm$mdatype) setup: damage one pv
77 #pvcreate -ff -y $dev1
78 # vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too
79 not vgreduce
--removemissing --mirrorsonly --force $vg1