summaryrefslogtreecommitdiff
path: root/loop-layer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'loop-layer.sh')
-rw-r--r--loop-layer.sh15
1 files changed, 0 insertions, 15 deletions
diff --git a/loop-layer.sh b/loop-layer.sh
deleted file mode 100644
index 7e08e12..0000000
--- a/loop-layer.sh
+++ /dev/null
@@ -1,15 +0,0 @@
1losetup_snapshot()
2{
3 local ro_dev rw_dev new_dev_name size persist chunksize
4 ro_file=$1
5 rw_file=$2
6
7 ro_dev=$(LoSetup -r -f --show "$ro_file") || return
8 rw_dev=$(LoSetup -f --show "$rw_file") || return
9 new_dev_name=${ro_dev##*/}
10 size=$(blockdev --getsz "$ro_dev") || return
11 persist=p
12 chunksize=16
13 dmsetup create "$new_dev_name" --table "0 $size snapshot $ro_dev $rw_dev $persist $chunksize" || return
14 echo /dev/mapper/"$new_dev_name"
15}