Whamcloud - gitweb
- obd filter works over ext2, but bonnie++ is buggie
[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 #
5 # Copyright (C) 2001  Cluster File Systems, Inc.
6 #
7 # This code is issued under the GNU General Public License.
8 # See the file COPYING in this distribution
9
10 OBDDIR="`dirname $0`/.."
11 . $OBDDIR/demos/config.sh
12
13 [ ! -d $MNTSNAP/lost+found ] && echo "need to run obdsetup.sh first" && exit 1
14 [ ! -f $MNTOBD/hosts ] && $OBDDIR/demos/snaptest.sh
15
16 plog umount $MNTSNAP
17 plog umount $MNTOBD
18
19 sync
20 sleep 1
21 plog log "STARTING snapdelete"
22 $OBDDIR/utils/obdcontrol -f << EOF
23 device /dev/obd2
24 connect
25 snapdelete
26 disconnect
27 cleanup
28 detach
29 snaptable
30 $SNAPTABLE
31 d
32 2
33 q
34 y
35 snapset 0 $SNAPTABLE
36 EOF
37 plog log "COMPLETE snapdelete"
38 plog mount -t obdfs -odevice=/dev/obd1 none $MNTOBD