2 # Utility script to test restoring a previous snapshot. This will destroy
3 # the "current" snapshot and restore the old one in its place.
4 OBDDIR="`dirname $0`/.."
5 [ "$OBDDIR" = "" ] && OBDDIR=".."
6 . $OBDDIR/demos/config.sh
8 [ ! -d $MNTSNAP/lost+found ] && echo "need to run snapsetup.sh first" && exit 1
15 plog log "STARTING snaprestore"
16 # To do a snapshot restore at this time, we need to do several steps. In
17 # the future, this should all be wrapped into the snaprestore function.
18 # - we reverse the current and restored entries in the snapshot table
19 # - we proceed to delete the previous current snapshot
20 # - we unconfigure the previous current snapshot
21 # - we delete the previous current snapshot from the table and load it
22 $OBDDIR/class/obdcontrol -f << EOF
23 XXX need to reverse current/restored entries here!!!
39 plog log "COMPLETE snaprestore"
41 plog mount -t obdfs -odevice=/dev/obd1 /dev/obd1 $MNTOBD