1
# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
3
# This copyrighted material is made available to anyone wishing to use,
4
# modify, copy, or redistribute it subject to the terms and conditions
5
# of the GNU General Public License v.2.
7
# You should have received a copy of the GNU General Public License
8
# along with this program; if not, write to the Free Software Foundation,
9
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
pvcreate --metadatacopies 0 $dev2
17
pvcreate --metadatacopies 0 $dev3
19
pvcreate --metadatacopies 0 $dev5
21
vgcreate -c n "$vg" $(cat DEVICES)
22
lvcreate -n $lv -l 1 -i5 -I256 $vg
31
# check that PVs without metadata don't cause too many full device rescans (bz452606)
33
pvcreate --metadatacopies $mdacp $(cat DEVICES)
35
vgcreate -c n $vg $(cat DEVICES)
36
lvcreate -n $lv1 -l 2 -i5 -I256 $vg
37
lvcreate -n $lv2 -m2 -l 2 $vg
42
lvchange -vvvv -an $vg/$lv1 >out$mdacp 2>&1
43
lvchange -vvvv -an $vg/$lv2 >>out$mdacp 2>&1
46
not grep "Cached VG .* incorrect PV list" out0
48
# some M1 metadata tests
52
pv3_uuid=$(pvs --noheadings -o pv_uuid $dev3)
53
vgcreate -M1 -c n $vg $dev1 $dev2 $dev3
56
# verify pe_start of all M1 PVs
58
check pv_field $dev1 pe_start $pv_align
59
check pv_field $dev2 pe_start $pv_align
60
check pv_field $dev3 pe_start $pv_align
62
pvs --units k -o name,pe_start,vg_mda_size,vg_name
64
# upgrade from v1 to v2 metadata
67
# verify pe_start of all M2 PVs
68
check pv_field $dev1 pe_start $pv_align
69
check pv_field $dev2 pe_start $pv_align
70
check pv_field $dev3 pe_start $pv_align
72
pvs --units k -o name,pe_start,vg_mda_size,vg_name
74
# create backup and then restore $dev3
75
vgcfgbackup -f $TESTDIR/bak-%s $vg
76
pvcreate -ff -y --restorefile $TESTDIR/bak-$vg --uuid $pv3_uuid $dev3
77
vgcfgrestore -f $TESTDIR/bak-$vg $vg
79
# verify pe_start of $dev3
80
check pv_field $dev3 pe_start $pv_align