~ubuntu-branches/debian/sid/lvm2/sid

« back to all changes in this revision

Viewing changes to test/shell/lvcreate-large-raid.sh

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2013-03-03 12:33:47 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20130303123347-smfwei6dodkdth55
Tags: 2.02.98-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
 
3
#
 
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.
 
7
#
 
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
 
11
 
 
12
# 'Exercise some lvcreate diagnostics'
 
13
 
 
14
. lib/test
 
15
 
 
16
aux target_at_least dm-raid 1 1 0 || skip
 
17
 
 
18
aux prepare_vg 5
 
19
 
 
20
lvcreate -s -l 20%FREE -n $lv1 $vg --virtualsize 256T
 
21
lvcreate -s -l 20%FREE -n $lv2 $vg --virtualsize 256T
 
22
lvcreate -s -l 20%FREE -n $lv3 $vg --virtualsize 256T
 
23
lvcreate -s -l 20%FREE -n $lv4 $vg --virtualsize 256T
 
24
lvcreate -s -l 20%FREE -n $lv5 $vg --virtualsize 256T
 
25
 
 
26
#FIXME this should be 1024T
 
27
#check lv_field $vg/$lv size "128.00m"
 
28
 
 
29
aux lvmconf 'devices/filter = [ "a/dev\/mapper\/.*$/", "a/dev\/LVMTEST/", "r/.*/" ]'
 
30
 
 
31
pvcreate $DM_DEV_DIR/$vg/$lv[12345]
 
32
vgcreate -c n $vg1 $DM_DEV_DIR/$vg/$lv[12345]
 
33
 
 
34
# bz837927 START
 
35
 
 
36
#
 
37
# Create large RAID LVs
 
38
#
 
39
# We need '--nosync' or our virtual devices won't work
 
40
lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
 
41
check lv_field $vg1/$lv1 size "200.00t"
 
42
lvremove -ff $vg1
 
43
 
 
44
for segtype in raid4 raid5 raid6; do
 
45
        lvcreate --type $segtype -i 3 -L 750T -n $lv1 $vg1 --nosync
 
46
        check lv_field $vg1/$lv1 size "750.00t"
 
47
        lvremove -ff $vg1
 
48
done
 
49
 
 
50
#
 
51
# Convert large linear to RAID1 (belong in different test script?)
 
52
#
 
53
lvcreate -L 200T -n $lv1 $vg1
 
54
# Need to deactivate or the up-convert will start sync'ing
 
55
lvchange -an $vg1/$lv1
 
56
lvconvert --type raid1 -m 1 $vg1/$lv1
 
57
check lv_field $vg1/$lv1 size "200.00t"
 
58
lvremove -ff $vg1
 
59
 
 
60
#
 
61
# Extending large RAID LV (belong in different script?)
 
62
#
 
63
lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
 
64
check lv_field $vg1/$lv1 size "200.00t"
 
65
lvextend -L +200T $vg1/$lv1
 
66
check lv_field $vg1/$lv1 size "400.00t"
 
67
lvremove -ff $vg1
 
68
 
 
69
# bz837927 END
 
70
 
 
71
lvremove -ff $vg