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
12 # Exercise various vgextend commands
23 pvcreate
-M$mdatype $dev1 $dev2 $dev3 $dev4 $dev5
24 vgcreate
-M$mdatype $vg1 $dev1 $dev2
25 vgextend
$vg1 $dev3 $dev4 $dev5
29 pvremove
$dev1 $dev2 $dev3 $dev4 $dev5
30 vgcreate
-M$mdatype $vg1 $dev1 $dev2
31 vgextend
-M$mdatype $vg1 $dev3 $dev4 $dev5
33 pvremove
$dev1 $dev2 $dev3 $dev4 $dev5
37 # Implicit pvcreate tests, test pvcreate options on vgcreate
38 # --force, --yes, --metadata{size|copies|type}, --zero
39 # --dataalignment[offset]
41 vgextend
--force --yes --zero y
$vg $dev1
47 # vgcreate (lvm2) succeeds writing LVM label at sector $i
48 vgextend
--labelsector $i $vg $dev1
49 dd if=$dev1 bs
=512 skip
=$i count
=1 2>/dev
/null |
strings |
grep -q LABELONE
;
57 vgextend
--pvmetadatacopies $i $vg $dev1
58 check_pv_field_
$dev1 pv_mda_count
$i
63 # metadatasize, dataalignment, dataalignmentoffset
64 #COMM 'pvcreate sets data offset next to mda area'
65 vgextend
--metadatasize 100k
--dataalignment 100k
$vg $dev1
66 check_pv_field_
$dev1 pe_start
200.00k
70 # data area is aligned to 64k by default,
71 # data area start is shifted by the specified alignment_offset
73 vgextend
--metadatasize 128k
--dataalignmentoffset 7s
$vg $dev1
74 check_pv_field_
$dev1 pe_start
$pv_align
78 # vgextend fails if pv belongs to existing vg
79 vgcreate
$vg1 $dev1 $dev3
81 not vgextend
$vg2 $dev3
84 pvremove
-f $dev1 $dev2 $dev3
86 #vgextend fails if vg is not resizeable
87 vgcreate
$vg1 $dev1 $dev2
88 vgchange
--resizeable n
$vg1
89 not vgextend
$vg1 $dev3
91 pvremove
-f $dev1 $dev2
93 # all PVs exist in the VG after extended
96 vgextend
$vg1 $dev1 $dev3
97 check_pv_field_
$dev1 vg_name
$vg1
98 check_pv_field_
$dev2 vg_name
$vg1
99 check_pv_field_
$dev3 vg_name
$vg1
101 pvremove
-f $dev1 $dev2 $dev3