From: adilger Date: Fri, 18 Oct 2002 23:34:45 +0000 (+0000) Subject: Remove ancient and unworking snapshot demo scripts. X-Git-Tag: 0.5.15~62 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9fa5c67a5f169d4d734a47876825aa60b975fef9;p=fs%2Flustre-release.git Remove ancient and unworking snapshot demo scripts. --- diff --git a/lustre/demos/Makefile.am b/lustre/demos/Makefile.am deleted file mode 100644 index 49d579d..0000000 --- a/lustre/demos/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (C) 2001 Cluster File Systems, Inc. -# -# This code is issued under the GNU General Public License. -# See the file COPYING in this distribution - -demo_SCRIPTS = baseclean.sh basesetup.sh obdfsclean.sh obdfssetup.sh \ - obdtest.sh snap3clean.sh snap3set.sh snapclean.sh snapdel.sh \ - snaprest.sh snaprestclean.sh snapsetup.sh snaptest.sh -demo_DATA = config.sh -EXTRA_DIST = $(demo_SCRIPTS) $(demo_DATA) - -include $(top_srcdir)/Rules - diff --git a/lustre/demos/baseclean.sh b/lustre/demos/baseclean.sh deleted file mode 100755 index 93730ee..0000000 --- a/lustre/demos/baseclean.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# Script to remove the loopback device and temp file created in newtest.sh -# -# 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 - - -mount | grep "$MNTOBD " > /dev/null 2>&1 -if [ x$? = x0 ]; then - echo "Stuff still mounted on $MNTOBD" - exit 1 -fi - -mount | grep "$MNTSNAP " > /dev/null 2>&1 -if [ x$? = x0 ]; then - echo "Stuff still mounted on $MNTSNAP" - exit 2 -fi - -mount | grep "$MNTSNAP2 " > /dev/null 2>&1 -if [ x$? = x0 ]; then - echo "Stuff still mounted on $MNTSNAP2" - exit 3 -fi - - -if [ "$LOOPDEV" ]; then - losetup -d $LOOPDEV - rmmod loop > /dev/null 2>&1 -fi - -if [ "$LOOPDEV" -a "$TMPFILE" -a -f "$TMPFILE" ]; then - rm -i $TMPFILE -fi - diff --git a/lustre/demos/basesetup.sh b/lustre/demos/basesetup.sh deleted file mode 100755 index 3b0bad8..0000000 --- a/lustre/demos/basesetup.sh +++ /dev/null @@ -1,68 +0,0 @@ -#! /bin/sh -# Get the locations for the files from a single place to avoid confusion -# -# 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`/.." - -# source config info -. $OBDDIR/demos/config.sh - -insmod obdclass -insmod obdext2 -insmod obdfs - -# module configuration -if [ "$MODCONF" -a -f $MODCONF ]; then - if [ -z "`grep -i "alias *char-major-$OBDMAJ *obdclass" $MODCONF`" ]; then - if [ -d /etc/modutils ]; then - # Debian-style modules configuration. - echo "alias char-major-${OBDMAJ} obdclass" > /etc/modutils/obd - update-modules - else - echo "alias char-major-${OBDMAJ} obdclass" >>$MODCONF - fi - fi -fi - - -# temp file -if [ "$LOOPDEV" -a "$TMPFILE" -a -f $TMPFILE ]; then - echo "$TMPFILE exists; I'm unwilling to overwrite it. Remove [N/y]?" 1>&2 - rm -i $TMPFILE - [ -f $TMPFILE ] && exit 1 -fi -[ "$TMPFILE" ] && dd if=/dev/zero of=$TMPFILE bs=1k count=$TMPSIZE - - -# loop device -if [ "$LOOPDEV" ]; then - insmod loop > /dev/null 2>&1 - if [ -a "`losetup $LOOPDEV 2> /dev/null`" ]; then - echo "It appears that $LOOPDEV is in use. Unable to continue" 1>&2 - echo "You need to clean up $LOOPDEV (via cleanup.sh)," - echo "or you can change which device is used in demos/config.sh" 1>&2 - # undo previous - [ "$TMPFILE" ] && rm $TMPFILE - exit 2 - fi - losetup $LOOPDEV $TMPFILE -fi - -# Ensure that we have the correct devices for OBD to work -[ ! -c /dev/obd0 ] && mknod /dev/obd0 c $OBDMAJ 0 -[ ! -c /dev/obd1 ] && mknod /dev/obd1 c $OBDMAJ 1 -[ ! -c /dev/obd2 ] && mknod /dev/obd2 c $OBDMAJ 2 - - -if [ "$BASEDEV" ]; then - # echo "No mke2fs!!" - mke2fs -r 0 -b 4096 $BASEDEV -else - echo "\$BASEDEV not defined in demos/config.sh. Please fix!" - [ "$LOOPDEV" ] && losetup -d $LOOPDEV - [ "$TMPFILE" ] && rm $TMPFILE - exit 3 -fi diff --git a/lustre/demos/config.sh b/lustre/demos/config.sh deleted file mode 100644 index 4d19a29..0000000 --- a/lustre/demos/config.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# File which holds configuation parameters in a single place to avoid any -# mismatch between scripts (especially the cleanup scripts, which are -# destructive). -# -# Copyright (C) 2001 Cluster File Systems, Inc. -# -# This code is issued under the GNU General Public License. -# See the file COPYING in this distribution -#set -vx - -# Major number for OBD devices -OBDMAJ=186 - -# Module configuration file -[ -f /etc/conf.modules ] && MODCONF=/etc/conf.modules -[ -z "$MODCONF" -a -f /etc/modules.conf ] && MODCONF=/etc/modules.conf - -# If LOOPDEV is empty (""), then no loopback device will be configured. -# If TMPFILE is empty (""), then no temporary file will be created for loop. -[ "$TMPFILE" ] || TMPFILE="/tmp/obdfs.tmpfile" -[ "$TMPSIZE" ] || TMPSIZE=10240 -[ -b /dev/loop/0 ] && LOOPDEV=/dev/loop/0 -[ -z "$LOOPDEV" -a -b /dev/loop0 ] && LOOPDEV="/dev/loop0" - -# If LOOPDEV is empty, then it is assumed that BASEDEV is a real block device -# that doesn't mind being overwritten - don't use a partition with data on it!! -LOOPDEV="/dev/loop0" -BASEDEV="/dev/loop0" - -# The following are mount points for the filesystems during the test. -MNTOBD="/mnt/obd" -MNTSNAP="/mnt/snap" -MNTSNAP2="/mnt/snap2" - -# This is where the snapshot table will be stored: -SNAPTABLE="/tmp/obdfs.snaptable" - -# A simple routine called by most of the scripts to help debugging. The -# kernel code has a lot of debugging statements, so this helps us keep -# track of what is going on in user-land to generate the kernel messages. -plog () { - if [ "$1" = "log" ]; then - shift - logger -p kern.info "******** $* **********" - echo "$*" - else - logger -p kern.info "****start**** $* *****" - echo "$*" - $* - logger -p kern.info "*****end***** $* *****" - fi -} - -# A routine to display a command, and prompt user if it should be run -qrun () { - echo - echo -n "Run '$*' [Y/n]?'"; - read JUNK - - case $JUNK in - n*|N*) echo "'$*' not run" ;; - *) plog $* ;; - esac -} diff --git a/lustre/demos/obdfsclean.sh b/lustre/demos/obdfsclean.sh deleted file mode 100755 index c0fa384..0000000 --- a/lustre/demos/obdfsclean.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# Utility script for cleaning up a simple OBDFS mounted filesystem -# -# 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 - -plog umount $MNTOBD -#killall pupdated # stop the OBDFS flush daemon -plog rmmod obdfs - -plog log "CLEANUP/DETACH" -$OBDDIR/utils/obdctl << EOF -device 0 -cleanup -detach -quit -EOF - -plog rmmod xfs -plog rmmod xfs_support -plog rmmod pagebuf -plog rmmod obdfilter -plog rmmod obdext2 -plog rmmod obdclass - -$OBDDIR/demos/baseclean.sh diff --git a/lustre/demos/obdfssetup.sh b/lustre/demos/obdfssetup.sh deleted file mode 100755 index 80acc66..0000000 --- a/lustre/demos/obdfssetup.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/bash -# Utility script for configuring a simple OBDFS mount -# -# 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 - -$OBDDIR/demos/basesetup.sh - -if [ x$? != x0 ]; then - echo "Error running basesetup.sh" - exit 4; -fi - -#insmod $OBDDIR/class/obdclass.o -#insmod $OBDDIR/ext2obd/obdext2.o -#insmod $OBDDIR/obdfs/obdfs.o - -plog log "ATTACHING device 0 SETUP $BASEDEV" -$OBDDIR/utils/obdctl << EOF -device 0 -# attach obdfilter -# setup $BASEDEV reiserfs -attach obdext2 -setup $BASEDEV -quit -EOF - -[ ! -d "$MNTOBD" ] && mkdir $MNTOBD -plog mount -t obdfs -odevice=/dev/obd0 none $MNTOBD diff --git a/lustre/demos/obdtest.sh b/lustre/demos/obdtest.sh deleted file mode 100755 index e1235f2..0000000 --- a/lustre/demos/obdtest.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/bash -# 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 - -[ ! -d $MNTOBD/lost+found ] && $OBDDIR/demos/obdfssetup.sh - -echo "echo yesterday >> $MNTOBD/hello" # create a file -echo "yesterday" > $MNTOBD/hello -echo "echo testing > $MNTOBD/goodbye" # create a file -echo "testing" > $MNTOBD/goodbye -plog ln -s hello $MNTOBD/link # create a symbolic link -cd $MNTOBD ; plog touch a b c ; cd - # create a file diff --git a/lustre/demos/snap3clean.sh b/lustre/demos/snap3clean.sh deleted file mode 100755 index a660ad2..0000000 --- a/lustre/demos/snap3clean.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# Utility script for cleaning up a third snapshot created by setup3.sh -# -# 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 - -plog umount $MNTSNAP2 - -plog log "CLEANUP /dev/obd3" -$OBDDIR/utils/obdcontrol -f << EOF -device /dev/obd3 -cleanup -detach -quit -EOF - -$OBDDIR/demos/snapclean.sh diff --git a/lustre/demos/snap3set.sh b/lustre/demos/snap3set.sh deleted file mode 100755 index d32baba..0000000 --- a/lustre/demos/snap3set.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Utility script for creating a third snapshot. -# -# 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 - -[ ! -d $MNTSNAP/lost+found ] && $OBDDIR/demos/snapsetup.sh - -$OBDDIR/demos/snaptest.sh - -sync -sleep 5 # let syslog logs get written - -plog log "CREATING /dev/obd3 snapshot" -$OBDDIR/utils/obdcontrol -f << EOF -snaptable -$SNAPTABLE -a -3 -now -q -y -snapset 0 $SNAPTABLE -device /dev/obd3 -attach obdsnap 0 3 0 -setup -quit -EOF - -[ ! -d "$MNTSNAP2" ] && mkdir $MNTSNAP2 -plog mount -t obdfs -oro,device=/dev/obd3 none $MNTSNAP2 diff --git a/lustre/demos/snapclean.sh b/lustre/demos/snapclean.sh deleted file mode 100755 index ecc94ee..0000000 --- a/lustre/demos/snapclean.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash -# Utility script for cleaning up snapshots and removing modules. -# -# 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 - -plog umount $MNTOBD -plog umount $MNTSNAP - -plog log "CLEANUP /dev/obd2 /dev/obd1" -$OBDDIR/utils/obdcontrol -f << EOF -device /dev/obd2 -cleanup -detach -device /dev/obd1 -cleanup -detach -quit -EOF - -rmmod obdsnap - -rm $SNAPTABLE -$OBDDIR/demos/obdfsclean.sh diff --git a/lustre/demos/snapdel.sh b/lustre/demos/snapdel.sh deleted file mode 100755 index 06e33a4..0000000 --- a/lustre/demos/snapdel.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# Utility script to test deleting a snapshot that has been previously -# created as the setup.sh script does. -# -# 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 - -[ ! -d $MNTSNAP/lost+found ] && echo "need to run obdsetup.sh first" && exit 1 -[ ! -f $MNTOBD/hosts ] && $OBDDIR/demos/snaptest.sh - -plog umount $MNTSNAP -plog umount $MNTOBD - -sync -sleep 1 -plog log "STARTING snapdelete" -$OBDDIR/utils/obdcontrol -f << EOF -device /dev/obd2 -connect -snapdelete -disconnect -cleanup -detach -snaptable -$SNAPTABLE -d -2 -q -y -snapset 0 $SNAPTABLE -EOF -plog log "COMPLETE snapdelete" -plog mount -t obdfs -odevice=/dev/obd1 none $MNTOBD diff --git a/lustre/demos/snaprest.sh b/lustre/demos/snaprest.sh deleted file mode 100755 index b139e39..0000000 --- a/lustre/demos/snaprest.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# Utility script to test restoring a previous snapshot. This will destroy -# the "current" snapshot and restore the old one in its place. -# -# 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 - -[ ! -d $MNTSNAP/lost+found ] && echo "need to run snapsetup.sh first" && exit 1 - -plog umount $MNTSNAP -plog umount $MNTOBD - -mount | grep "$MNTOBD " > /dev/null 2>&1 -if [ x$? = x0 ]; then - echo "Stuff still mounted on $MNTOBD; clean up first." - exit -fi - -mount | grep "$MNTSNAP " > /dev/null 2>&1 -if [ x$? = x0 ]; then - echo "Stuff still mounted on $MNTSNAP; clean up first." - exit -fi - -sync -plog log "STARTING snaprestore" - - -$OBDDIR/utils/obdcontrol -f << EOF -device /dev/obd1 -cleanup -detach -device /dev/obd2 -connect -snaprestore 2 $SNAPTABLE 0 -quit -EOF - -plog log "COMPLETE snaprestore" - -plog mount -t obdfs -odevice=/dev/obd2 none $MNTOBD diff --git a/lustre/demos/snaprestclean.sh b/lustre/demos/snaprestclean.sh deleted file mode 100755 index 4b3b57d..0000000 --- a/lustre/demos/snaprestclean.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/bash -# Utility script for cleaning up a simple OBDFS mounted filesystem -# -# 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 - -umount $MNTOBD -mount | grep "$MNTOBD " > /dev/null 2>&1 -if [ x$? = x0 ]; then - echo "Stuff still mounted on $MNTOBD; clean up first." - exit -fi - -rmmod obdfs - -$OBDDIR/utils/obdcontrol -f << EOF -device /dev/obd2 -cleanup -detach -device /dev/obd0 -cleanup -detach -quit -EOF - -rmmod obdsnap -rmmod obdext2 -rmmod obdclass - -rm $SNAPTABLE -$OBDDIR/demos/baseclean.sh diff --git a/lustre/demos/snapsetup.sh b/lustre/demos/snapsetup.sh deleted file mode 100755 index 7db6ab1..0000000 --- a/lustre/demos/snapsetup.sh +++ /dev/null @@ -1,73 +0,0 @@ -#! /bin/bash -# 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 -if [ ! -d /mnt/obd/lost+found ]; then - $OBDDIR/demos/obdfssetup.sh - if [ x$? != x0 ]; then - echo "Error running obdfssetup.sh" - exit 4 - fi -fi - -if [ ! -f $MNTOBD/hello ]; then - $OBDDIR/demos/obdtest.sh - if [ x$? != x0 ]; then - echo "Error in obdfssetup.sh" - exit 4 - fi -fi - -plog umount $MNTOBD - -#plog insmod $OBDDIR/snap/obdsnap.o - -rm -f $SNAPTABLE - -plog log "NEW SNAP SETUP" -# Create two snapshots using the OBD snapshot driver. One will be the -# "current" snapshot (in obd device 1), where changes will take place. -# The current snapshot is required in order to use the filesystem. The -# second will be a snapshot of the filesystem taken "now" (in obd device 2) -# that will remain static (historical read-only) filesystem as changes -# are made to the current snapshot. -$OBDDIR/utils/obdcontrol -f << EOF -snaptable -$SNAPTABLE -a -1 -current -a -2 -now -q -y -snapset 0 $SNAPTABLE -device /dev/obd1 -attach obdsnap 0 1 0 -setup -device /dev/obd2 -attach obdsnap 0 2 0 -setup -quit -EOF - -# Mount the two filesystems. The filesystem under $MNTOBD will be the -# 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 diff --git a/lustre/demos/snaptest.sh b/lustre/demos/snaptest.sh deleted file mode 100755 index 675a529..0000000 --- a/lustre/demos/snaptest.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Utility script to perform minor modifications to the read-write mounted -# snapshot in order to demonstrate the changes w.r.t. the read-only snapshot -# -# 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 - -plog chmod 777 $MNTOBD # change attributes on an existing file -plog rm $MNTOBD/a # delete an existing file -echo "echo today >> $MNTOBD/hello" # modify an existing file -echo today >> $MNTOBD/hello -plog cp /etc/group $MNTOBD # create a new file -plog ln -s goodbye $MNTOBD/newlink # create a new symlink