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

« back to all changes in this revision

Viewing changes to test/shell/lvcreate-thin-snap.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
 
 
3
# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
 
4
#
 
5
# This copyrighted material is made available to anyone wishing to use,
 
6
# modify, copy, or redistribute it subject to the terms and conditions
 
7
# of the GNU General Public License v.2.
 
8
#
 
9
# You should have received a copy of the GNU General Public License
 
10
# along with this program; if not, write to the Free Software Foundation,
 
11
# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
12
 
 
13
. lib/test
 
14
 
 
15
check_lv_field_modules_()
 
16
{
 
17
        mod=$1
 
18
        shift
 
19
 
 
20
        for d in $*; do
 
21
                check lv_field $vg/$d modules $mod
 
22
        done
 
23
}
 
24
 
 
25
 
 
26
#
 
27
# Main
 
28
#
 
29
aux have_thin 1 0 0 || skip
 
30
 
 
31
aux prepare_pvs 2 64
 
32
 
 
33
vgcreate $vg -s 64K $(cat DEVICES)
 
34
 
 
35
lvcreate -L10M -V10M -T $vg/pool --name $lv1
 
36
mkfs.ext4 $DM_DEV_DIR/$vg/$lv1
 
37
# create thin snapshot of thin LV
 
38
lvcreate -s $vg/$lv1
 
39
# check snapshot filesystem was properly frozen before snapping
 
40
fsck -p $DM_DEV_DIR/$vg/lvol0
 
41
lvcreate -s $vg/$lv1 --name $lv2
 
42
lvcreate -s $vg/$lv1 --name $vg/$lv3
 
43
lvcreate --type snapshot $vg/$lv1
 
44
lvcreate --type snapshot $vg/$lv1 --name $lv4
 
45
lvcreate --type snapshot $vg/$lv1 --name $vg/$lv5
 
46
 
 
47
# create old-style snapshot
 
48
lvcreate -s -L10M --name oldsnap1 $vg/$lv2
 
49
lvcreate -s -L10M --name oldsnap2 $vg/$lv2
 
50
 
 
51
# thin snap of snap of snap...
 
52
lvcreate -s --name sn1 $vg/$lv2
 
53
lvcreate -s --name sn2 $vg/sn1
 
54
lvcreate -s --name sn3 $vg/sn2
 
55
lvcreate -s --name sn4 $vg/sn3
 
56
 
 
57
vgremove -ff $vg