Whamcloud - gitweb
demos/*: update demos to handle module autoloading (Steve Bruggeman)
[fs/lustre-release.git] / lustre / demos / snapsetup.sh
index f7ef4df..b8b5eaa 100755 (executable)
@@ -3,22 +3,14 @@
 # not already mounted on /mnt/obd, we call the basic OBD setup script to
 # create and mount a filesystem for us.
 OBDDIR="`dirname $0`/.."
-
 . $OBDDIR/demos/config.sh
 
 
 # prepare the snapshot drive with a file to be COW'd
-
-mount | grep $MNTOBD > /dev/null 2>&1
-if [ x$? = x0 ]; then 
-    echo "Stuff still mounted on $MNTOBD; clean up first."
-    exit 
-fi
-
 if [ ! -d /mnt/obd/lost+found ]; then 
     $OBDDIR/demos/obdfssetup.sh
     if [ x$? != x0 ]; then 
-       echo "Error in obdfssetup.sh"
+       echo "Error running obdfssetup.sh"
        exit 4
    fi
 fi
@@ -31,9 +23,9 @@ if [ ! -f $MNTOBD/hello ]; then
     fi
 fi
 
-umount $MNTOBD
+plog umount $MNTOBD
 
-insmod $OBDDIR/snap/obdsnap.o
+#plog insmod $OBDDIR/snap/obdsnap.o
 
 rm -f $SNAPTABLE
 
@@ -57,10 +49,10 @@ q
 y
 snapset 0 $SNAPTABLE
 device /dev/obd1
-attach snap_obd 0 1 0
+attach obdsnap 0 1 0
 setup
 device /dev/obd2
-attach snap_obd 0 2 0
+attach obdsnap 0 2 0
 setup
 quit
 EOF
@@ -69,5 +61,7 @@ EOF
 # one where changes are made, while $MNTSNAP will contain the original
 # files at the point when the snapshot was taken.
 
+[ ! -d "$MNTOBD" ] &&  mkdir $MNTOBD
+[ ! -d "$MNTSNAP" ] &&  mkdir $MNTSNAP
 plog mount -t obdfs -odevice=/dev/obd1 none $MNTOBD
 plog mount -t obdfs -oro,device=/dev/obd2 none $MNTSNAP