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

« back to all changes in this revision

Viewing changes to test/shell/snapshot-merge.sh

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2014-08-19 15:37:06 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20140819153706-i1gaio8lg534dara
Tags: 2.02.109-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
# along with this program; if not, write to the Free Software Foundation,
10
10
# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
11
11
 
12
 
. lib/test
 
12
. lib/inittest
13
13
 
14
14
which mkfs.ext3 || skip
15
15
 
25
25
    local VG_NAME=$1
26
26
    local LV_NAME=$2
27
27
    local NUM_EXTRA_SNAPS=${3:-0}
28
 
    local BASE_SNAP_LV_NAME=$(snap_lv_name_ $LV_NAME)
 
28
    local BASE_SNAP_LV_NAME
 
29
 
 
30
    BASE_SNAP_LV_NAME=$(snap_lv_name_ $LV_NAME)
29
31
 
30
32
    lvcreate -aey -n $LV_NAME -l 50%FREE $VG_NAME
31
33
    lvcreate -s -n $BASE_SNAP_LV_NAME -l 20%FREE ${VG_NAME}/${LV_NAME}
33
35
 
34
36
    if [ $NUM_EXTRA_SNAPS -gt 0 ]; then
35
37
        for i in $(seq 1 $NUM_EXTRA_SNAPS); do
36
 
            lvcreate -s -n ${BASE_SNAP_LV_NAME}_${i} -l 20%FREE ${VG_NAME}/${LV_NAME}
 
38
            lvcreate -s -n ${BASE_SNAP_LV_NAME}_${i} -l 20%ORIGIN ${VG_NAME}/${LV_NAME}
37
39
        done
38
40
    fi
39
41
}