Whamcloud - gitweb
52c6ceee4afe877ccc25ba687967ed85cb801184
[fs/lustre-release.git] / lustre / demos / snaprestclean.sh
1 #! /bin/bash
2 # Utility script for cleaning up a simple OBDFS mounted filesystem
3 OBDDIR="`dirname $0`/.."
4 . $OBDDIR/demos/config.sh
5
6 umount $MNTOBD
7 mount | grep "$MNTOBD " > /dev/null 2>&1
8 if [ x$? = x0 ]; then 
9     echo "Stuff still mounted on $MNTOBD; clean up first."
10     exit 
11 fi
12
13 rmmod obdfs
14
15 $OBDDIR/class/obdcontrol -f << EOF
16 device /dev/obd2
17 cleanup
18 detach
19 device /dev/obd0
20 cleanup
21 detach
22 quit
23 EOF
24
25 rmmod obdsnap
26 rmmod obdext2
27 rmmod obdclass
28
29 rm $SNAPTABLE
30 $OBDDIR/demos/baseclean.sh