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
16 pvcreate
--metadatacopies 0 $dev2
17 pvcreate
--metadatacopies 2 $dev3
20 # failing, but still removing everything what can be removed
21 # is somewhat odd as default, what do we have -f for?
23 pvcreate
--metadatacopies 0 $dev2
25 # check pvremove refuses to remove pv in a vg
26 vgcreate
-c n
$vg $dev1 $dev2
27 not pvremove
$dev2 $dev3
29 for mdacp
in 0 1 2; do
30 # check pvremove truly wipes the label (pvscan wont find) (---metadatacopies $mdacp)
31 pvcreate
--metadatacopies $mdacp $dev3
33 # try to remove agail - should fail cleanly
35 pvscan | not
grep $dev3
37 # bz179473 refuse to wipe non-PV device without -f
43 pvcreate
--metadatacopies $mdacp $dev1
45 vgcreate
$vg $dev1 $dev2
47 # pvremove -f fails when pv in a vg (---metadatacopies $mdacp)
51 # pvremove -ff fails without confirmation when pv in a vg (---metadatacopies $mdacp)
52 echo n | not pvremove
-ff $dev1
54 # pvremove -ff succeds with confirmation when pv in a vg (---metadatacopies $mdacp)
55 yes | pvremove
-ff $dev1
58 vgreduce
--removemissing $vg
59 pvcreate
--metadatacopies $mdacp $dev1
62 # pvremove -ff -y is sufficient when pv in a vg (---metadatacopies $mdacp)" '
63 echo n | pvremove
-ff -y $dev1
65 vgreduce
--removemissing $vg
66 pvcreate
--metadatacopies $mdacp $dev1