# Utility script to create an OBD snapshot. If an existing filesystem is
# not already mounted on /mnt/obd, we call the basic OBD setup script to
# create and mount a filesystem for us.
+#
+# Copyright (C) 2001 Cluster File Systems, Inc.
+#
+# This code is issued under the GNU General Public License.
+# See the file COPYING in this distribution
+
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
fi
fi
-umount $MNTOBD
+plog umount $MNTOBD
-insmod $OBDDIR/snap/obdsnap.o
+#plog insmod $OBDDIR/snap/obdsnap.o
rm -f $SNAPTABLE
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
# 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