X-Git-Url: http://xvm.mit.edu/gitweb/invirt/scripts/pv-fixup.git/blobdiff_plain/1c8ae3c8d39df16bde30d27595043f5dab8c7f04..19bafeba15353cfaebb45c52a1f3bc895722afce:/cheap-unsnapshot.sh diff --git a/cheap-unsnapshot.sh b/cheap-unsnapshot.sh new file mode 100644 index 0000000..73feccd --- /dev/null +++ b/cheap-unsnapshot.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e +set -x + +BASE="$1" +BASEDUP="basedup" +ORIGIN="origin" +TOP="top" + +[ -e "/dev/mapper/$BASE" ] || exit 1 + +dmsetup suspend $BASE +dmsetup remove $TOP +dmsetup remove $ORIGIN +dmsetup table $BASEDUP | dmsetup load $BASE +dmsetup resume $BASE