Whamcloud - gitweb
Update copyright and license information.
[fs/lustre-release.git] / lustre / demos / snaprestclean.sh
1 #! /bin/bash
2 # Utility script for cleaning up a simple OBDFS mounted filesystem
3 #
4 # Copyright (C) 2001  Cluster File Systems, Inc.
5 #
6 # This code is issued under the GNU General Public License.
7 # See the file COPYING in this distribution
8
9 OBDDIR="`dirname $0`/.."
10 . $OBDDIR/demos/config.sh
11
12 umount $MNTOBD
13 mount | grep "$MNTOBD " > /dev/null 2>&1
14 if [ x$? = x0 ]; then 
15     echo "Stuff still mounted on $MNTOBD; clean up first."
16     exit 
17 fi
18
19 rmmod obdfs
20
21 $OBDDIR/class/obdcontrol -f << EOF
22 device /dev/obd2
23 cleanup
24 detach
25 device /dev/obd0
26 cleanup
27 detach
28 quit
29 EOF
30
31 rmmod obdsnap
32 rmmod obdext2
33 rmmod obdclass
34
35 rm $SNAPTABLE
36 $OBDDIR/demos/baseclean.sh