Whamcloud - gitweb
7fc872de9e6a82187bede98f5d954c463c2d3a86
[fs/lustre-release.git] / lustre / demos / snapdel.sh
1 #!/bin/sh
2 # Utility script to test deleting a snapshot that has been previously
3 # created as the setup.sh script does.
4 OBDDIR="`dirname $0`/.."
5 . $OBDDIR/demos/config.sh
6
7 [ ! -d $MNTSNAP/lost+found ] && echo "need to run obdsetup.sh first" && exit 1
8 [ ! -f $MNTOBD/hosts ] && $OBDDIR/demos/snaptest.sh
9
10 plog umount $MNTSNAP
11 plog umount $MNTOBD
12
13 sync
14 sleep 1
15 plog log "STARTING snapdelete"
16 $OBDDIR/class/obdcontrol -f << EOF
17 device /dev/obd2
18 connect
19 snapdelete
20 disconnect
21 cleanup
22 detach
23 snaptable
24 $SNAPTABLE
25 d
26 2
27 q
28 y
29 snapset 0 $SNAPTABLE
30 EOF
31 plog log "COMPLETE snapdelete"
32 plog mount -t obdfs -odevice=/dev/obd1 none $MNTOBD