Whamcloud - gitweb
class/obdcontrol: added "basedev" parameter to the attach command
[fs/lustre-release.git] / lustre / demos / snapdel.sh
diff --git a/lustre/demos/snapdel.sh b/lustre/demos/snapdel.sh
new file mode 100755 (executable)
index 0000000..ed39a8e
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Utility script to test deleting a snapshot that has been previously
+# created as the setup.sh script does.
+OBDDIR="`dirname $0`/.."
+[ "$OBDDIR" = "" ] && OBDDIR=".."
+. $OBDDIR/demos/config.sh
+
+[ ! -d $MNTSNAP/lost+found ] && echo "need to run obdsetup.sh first" && exit 1
+plog umount $MNTSNAP
+plog umount $MNTOBD
+
+sync
+sleep 1
+plog log "STARTING snapdelete"
+$OBDDIR/class/obdcontrol -f << EOF
+device /dev/obd2
+connect
+snapdelete
+disconnect
+cleanup
+detach
+snaptable
+$SNAPTABLE
+d
+2
+q
+y
+snapset 0 $SNAPTABLE
+EOF
+plog log "COMPLETE snapdelete"
+plog mount -t obdfs -odevice=/dev/obd1 /dev/obd1 $MNTOBD