Add scripts for making snapshots of LVs with dm-snapshot even when those LVs reside...
[invirt/scripts/pv-fixup.git] / cheap-unsnapshot.sh
1 #!/bin/sh
2
3 set -e
4 set -x
5
6 BASE="$1"
7 BASEDUP="basedup"
8 ORIGIN="origin"
9 TOP="top"
10
11 [ -e "/dev/mapper/$BASE" ] || exit 1
12
13 dmsetup suspend $BASE
14 dmsetup remove $TOP
15 dmsetup remove $ORIGIN
16 dmsetup table $BASEDUP | dmsetup load $BASE
17 dmsetup resume $BASE