Whamcloud - gitweb
Fixes to shell scripts to check for errors and other improvements
[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
5 . $OBDDIR/demos/config.sh
6
7 umount $MNTOBD
8 mount | grep $MNTOBD > /dev/null 2>&1
9 if [ x$? = x0 ]; then 
10     echo "Stuff still mounted on $MNTOBD; clean up first."
11     exit 
12 fi
13
14 rmmod obdfs
15
16 $OBDDIR/class/obdcontrol -f << EOF
17 device /dev/obd2
18 cleanup
19 detach
20 device /dev/obd0
21 cleanup
22 detach
23 quit
24 EOF
25
26 rmmod obdsnap
27 rmmod obdext2
28 rmmod obdclass
29
30 $OBDDIR/demos/baseclean.sh