X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fdemos%2Fsnapsetup.sh;h=ff95718b04a42c122aea3de1e5d6d83dc9bdf900;hb=23cb2304012eca005941811f0585aee5dd985cfc;hp=b28bbd6e2368f5aedf8f228321fe109a9342ecb3;hpb=07e3542883fcdba0a6a8b5f927ca5a2e647b72b7;p=fs%2Flustre-release.git diff --git a/lustre/demos/snapsetup.sh b/lustre/demos/snapsetup.sh index b28bbd6..ff95718 100755 --- a/lustre/demos/snapsetup.sh +++ b/lustre/demos/snapsetup.sh @@ -2,17 +2,17 @@ # 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 @@ -29,9 +29,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 @@ -55,10 +55,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 @@ -67,5 +67,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