Erasing tape
Dumping to tape...
xfsdump -s DUMP_SUBDIR -f TAPE_DEV -M stress_tape_media -L stress_022 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_022 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -s DUMP_SUBDIR -f TAPE_DEV -M stress_tape_media -L stress_023 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_023 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -l0 -f TAPE_DEV -M stress_tape_media -L stress_024 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Erasing tape
Dumping incrementally to tape...
xfsdump -l1 -f TAPE_DEV -M stress_tape_media -L stress_024 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 1 incremental dump of HOSTNAME:SCRATCH_MNT based on level 0 dump begun DATE
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_024 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -m -b 1048576 -l0 -f TAPE_DEV -M stress_tape_media -L stress_025 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Rewinding tape
Restoring from tape...
xfsrestore -m -b 1048576 -f TAPE_DEV -L stress_025 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Setup ....................................
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L stress_026 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Restoring from file...
xfsrestore -f DUMP_FILE -L stress_026 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: examining media file 0
Setup ....................................
xfsdump|xfsrestore ...
xfsdump -s DUMP_SUBDIR - SCRATCH_MNT | xfsrestore - RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: dump description:
xfsrestore: restoring non-directory files
xfsrestore: restore complete: SECS seconds elapsed
xfsrestore: Restore Status: SUCCESS
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
QA output created by 028
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.0 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.1 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.2 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.3 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.4 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Erasing tape
Dumping to tape...
xfsdump -l0 -f TAPE_DEV -M stress_tape_media -L 035.1 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Setup ....
Dumping to tape...
xfsdump -l0 -f TAPE_DEV -M stress_tape_media -L 035.2 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 4)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L 035.2 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -o -F -m -b 1048576 -l0 -f TAPE_DEV -M stress_tape_media -L stress_036 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Rewinding tape
Restoring from tape...
xfsrestore -m -b 1048576 -f TAPE_DEV -L stress_036 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -o -F -m -b 1048576 -l0 -f TAPE_DEV -M stress_tape_media -L stress_037 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Rewinding tape
Restoring from tape...
xfsrestore -m -b 1048576 -f TAPE_DEV -L stress_037 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -l0 -f TAPE_DEV -M stress_tape_media -L stress_038 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_038 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -o -F -l0 -f TAPE_DEV -M stress_tape_media -L stress_039 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_039 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Erasing tape
Dumping to tape...
xfsdump -s DUMP_SUBDIR -f TAPE_DEV -M stress_tape_media -L stress_043 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: beginning media stream terminator
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending media stream terminator
-xfsdump: media stream terminator size 1048576 bytes
+xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_043 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: searching media for dump
xfsrestore: preparing drive
xfsrestore: examining media file 0
Setup ....
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L stress_046 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Restoring from file...
xfsrestore -f DUMP_FILE -L stress_046 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: examining media file 0
QA output created by 047
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.0 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.1 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.2 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.3 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L session.4 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Erasing tape
Dumping to tape...
xfsdump -o -F -l0 -f TAPE_DEV -M stress_tape_media -L stress_055 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_055 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
Setup ..........
Dumping to file...
xfsdump -f DUMP_FILE -M stress_tape_media -L stress_056 SCRATCH_MNT
-xfsdump: version 3.0 - Running single-threaded
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: Dump Status: SUCCESS
Restoring from file...
xfsrestore -f DUMP_FILE -L stress_056 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: examining media file 0
Setup ..........
Restoring from file...
xfsrestore -f DUMP_FILE -L stress_056 RESTORE_DIR
-xfsrestore: version 3.0 - Running single-threaded
xfsrestore: searching media for dump
xfsrestore: examining media file 0
xfsrestore: found dump matching specified label:
fi
# Use dump/restore in qa directory for debugging
-#PATH=".:$PATH"
-#export PATH
+PATH=".:$PATH"
+export PATH
#which xfsdump
#which xfsrestore
+#which xfsinvutil
# status returned for not run tests
NOTRUNSTS=2
# name those directories
dump_file=$tmp.dumpfile
+# dump_file=$here/dumpfile #TEMP OVERRIDE DUMP FILE
dump_sdir=dumpdir
dump_dir=$SCRATCH_MNT/$dump_sdir
restore_sdir=restoredir
restore_dir=$SCRATCH_MNT/$restore_sdir
-
+multi=3
dumptape=$TAPE_DEV
media_label="stress_tape_media"
session_label="stress_$seq"
fi
done
+# remove this when xfstests irix/linux port done
+if [ "X$XFS_HOST_OS" = "Xirix" ]
+then # IRIX
+ have_mtvariable=false
+ MKFS_OPTS=""
+else # Linux
+ have_mtvariable=true
+ MKFS_OPTS="-f"
+fi
+
#
# do a remote/local mt
#
_set_variable()
{
+ $have_mtvariable || return
+
if _isrmt; then
:
else
{
_require_scratch
- mkfs -t xfs -f $SCRATCH_DEV >>$seq.full ||\
+ mkfs -t xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full ||\
_error "mkfs failed"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
# save it for inspection
for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
[ -d $dir ] || continue
- tar -zcvf $seq.inventory.tgz $dir
+ tar -cvf $seq.inventory.tar $dir
ls -lR $dir >$seq.inventory.ls
done
fi
fi
}
+#
+# ensure that bulkstat data will
+# match with incore data
+# by forcing disk data to be written out
+#
_stable_fs()
{
umount $SCRATCH_MNT >>$seq.full ||\
echo "-----------------------------------------------"
echo "fsstress : $_param"
echo "-----------------------------------------------"
- if ! $here/src/fsstress $_param $FSSTRESS_AVOID -n $_count -d $dump_dir >$tmp.out 2>&1
+ if ! $here/src/fsstress $_param -s 1 $FSSTRESS_AVOID -n $_count -d $dump_dir >$tmp.out 2>&1
then
echo " fsstress (count=$_count) returned $? - see $seq.full"
End-of-File
}
+_mk_fillconfig_ea()
+{
+ cat <<End-of-File >$tmp.config
+# pathname size user group perm name value
+#
+smalll 10 $nobody $nobody 777 attr1 some_text
+biggg 102400 $nobody $nobody 777 attr2 some_text2
+sub/smalll 10 $nobody $nobody 777 attr3 some_text3
+sub/biggg 102400 $nobody $nobody 777 attr4 some_text4
+dir d $nobody $nobody 777 attr5 dir_text
+#
+# Add more files so that there are more than the number
+# of streams.
+# There are bugs in dump/restore for # non-dir files < # streams
+# It can be tested in another configuration.
+# It is a pathalogical case.
+#
+sub/a 1 $nobody $nobody
+sub/b 2 $nobody $nobody
+sub/c 4 $nobody $nobody
+sub/d 8 $nobody $nobody
+sub/e 16 $nobody $nobody
+sub/f 32 $nobody $nobody
+sub/g 64 $nobody $nobody
+sub/h 128 $nobody $nobody
+sub/i 256 $nobody $nobody
+sub/j 512 $nobody $nobody
+sub/k 1024 $nobody $nobody
+sub/l 2048 $nobody $nobody
+sub/m 4096 $nobody $nobody
+sub/n 8192 $nobody $nobody
+End-of-File
+}
+
#
# Create a bunch of directories/files of different sizes
# filled with data.
$verbose && echo -n "Setup "
sed -e '/^#/d' $tmp.config \
- | while read file nbytes owner group perms
+ | while read file nbytes owner group perms ea_name ea_value
do
if [ $nbytes = "d" ]; then
# create a directory
if [ -n "$perms" ]; then
chmod $perms $file
fi
+ if [ -n "$ea_name" -a -n "$ea_value" ]; then
+ attr -s $ea_name -V $ea_value $file
+ fi
$verbose && echo -n "."
done
$verbose && echo
_stable_fs
}
+_create_dumpdir_fill_ea()
+{
+ _wipe_fs
+ _mk_fillconfig_ea
+ _do_create_dumpdir_fill
+ _stable_fs
+}
#
#
# Filter for ls
-# Filter out dates on symlinks
+# Filter out dates on symlinks and char devices
#
_ls_filter()
{
- $AWK_PROG '/^l/ { date = $8; sub(date,"DATE"); print}
+ $AWK_PROG '
+ /^l/ { date = $8; sub(date,"DATE"); print}
+ /^c/ { date = $9; sub(date,"DATE"); print}
{print}' \
| sed -e 's/total [0-9][0-9]*/total TOTAL/'
}
sed \
-e "s/`hostname`/HOSTNAME/" \
-e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
+ -e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
-e "s#$dumptape#TAPE_DEV#" \
-e "s#$SCRATCH_MNT#SCRATCH_MNT#" \
-e "s#$dump_file#DUMP_FILE#" \
-e 's/date:[ ].*/date: DATE/' \
-e 's/dump begun .*/dump begun DATE/' \
-e 's/[0-9][0-9]* seconds/SECS seconds/' \
+ -e 's/restore.[0-9][0-9]*/restore.PID/' \
-e 's/ino [0-9][0-9]*/ino INO/' \
-e '/: dump size/s/[0-9][0-9]*/NUM/' \
-e '/dump size:/s/[0-9][0-9]*/NUM/' \
- -e '/media file size/s/[0-9][0-9]*/NUM/' \
- -e '/mfile size:[ ]*/s/[0-9][0-9]*/NUM/' \
+ -e '/dump size per stream:/s/[0-9][0-9]*/NUM/' \
+ -e 's/\(media file size[ ]*\)[0-9][0-9]*/\1NUM/' \
+ -e 's/\(mfile size:[ ]*\)[0-9][0-9]*/\1NUM/' \
+ -e '/drive[ ]*[0-9][0-9]*:/d' \
-e '/\/dev\/tty/d' \
-e '/inventory session uuid/d' \
- -e 's#/var/lib/xfsdump#/var/xfsdump#' \
-
+ -e '/ - Running single-threaded/d' \
+ -e '/^.*I\/O metrics: .*$/d' \
+ -e 's/1048576/BLOCKSZ/' \
+ -e 's/2097152/BLOCKSZ/' \
+ -e 's/(pid[ ]*[1-9][0-9]*)/\(pid PID\)/' \
+ | perl -ne '
+ if ($_ =~ /(?:Dump|Restore) Summary/) {
+ $skip = 1;
+ } elsif ($_ =~ /(?:Dump|Restore) Status/) {
+ $skip = 0;
+ }
+ print if (! $skip);'
}
_dump_filter()
{
- if $do_quota_check
- then
- _dump_filter_main | _check_quota_dumprestore
- else
- _dump_filter_main
- fi
+ if $do_quota_check
+ then
+ _dump_filter_main | _check_quota_dumprestore
+ else
+ _dump_filter_main
+ fi
}
_invutil_filter()
}
+
_dir_filter()
{
sed \
-e "s#$dump_file#DUMP_FILE#" \
-e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
+ -e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
-e "s#$dumptape#TAPE_DEV#" \
-e "s#$dump_dir#DUMP_DIR#g" \
-e "s#$restore_dir#RESTORE_DIR#g" \
-e "s#$SCRATCH_MNT#SCRATCH_MNT#g" \
-e "s#$dump_sdir#DUMP_SUBDIR#g" \
-e "s#$restore_sdir#RESTORE_SUBDIR#g" \
+ -e "s#$$#PID#g" \
}
{
OPTIND=0
dump_args=""
- while getopts "f:FL:oqQ" c $*
+ while [ $# -gt 0 ]
do
- case $c
+ case $1
in
- f)
- [ -z "$OPTARG" ] && _error "missing argument for -f"
- dumptape=$OPTARG
+ -f)
+ [ -z "$2" ] && _error "missing argument for -f"
+ dumptape=$2
+ shift
;;
- L)
- [ -z "$OPTARG" ] && _error "missing argument for -L"
- session_label=$OPTARG
+ -L)
+ [ -z "$2" ] && _error "missing argument for -L"
+ session_label=$2
+ shift
;;
- o)
+ -o)
dump_args="$dump_args -o"
;;
- F)
+ -F)
dump_args="$dump_args -F"
;;
- q)
- do_quota_check=true
+ --multi)
+ multi=$2
+ shift
+ ;;
+ -q)
+ do_quota_check=true
;;
- Q)
- do_quota_check=false
+ -Q)
+ do_quota_check=false
;;
- \?)
+ *)
_error "invalid argument"
;;
esac
+ shift
done
}
xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
}
+#
+# Do full dump to multiple files
+#
+_do_dump_multi_file()
+{
+ _parse_args "$@"
+
+ multi_args=""
+
+ i=0
+ while [ $i -lt $multi ]
+ do
+ multi_args="$multi_args -f $dump_file.$i -M $media_label.$i"
+ i=`expr $i + 1`
+ done
+
+ echo "Dumping to files..."
+ opts="$_dump_debug$dump_args $multi_args -L $session_label $SCRATCH_MNT"
+ echo "xfsdump $opts" | _dir_filter
+ xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
+}
+
_prepare_restore_dir()
{
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
}
+#
+# Restore the tape from multiple dump files
+#
+_do_restore_multi_file()
+{
+ _parse_args "$@"
+ _prepare_restore_dir
+
+ multi_args=""
+
+ i=0
+ while [ $i -lt $multi ]
+ do
+ multi_args="$multi_args -f $dump_file.$i"
+ i=`expr $i + 1`
+ done
+
+ echo "Restoring from file..."
+ opts="$_restore_debug$dump_args $multi_args -L $session_label $restore_dir"
+ echo "xfsrestore $opts" | _dir_filter
+ xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
+}
+
#
# Do xfsdump piped into xfsrestore - xfsdump | xfsrestore
#
diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
}
-
#
# Compare using recursive diff the files of the dumped
# subdirectory.
_diff_compare_sub()
{
echo "Comparing dump directory with restore directory"
- diff -rs $dump_dir $restore_dir/$dump_sdir | _dir_filter
+ diff -rs $dump_dir $restore_dir/$dump_sdir | _dir_filter | _check_quota_diff
+}
+
+_get_eas_on_path()
+{
+ _path=$1
+
+ find $_path -exec attr -l {} \; |\
+ awk '{print $9, $2}' |\
+ sed 's/["]//g' |\
+ while read file ea_name; do
+ attr -g $ea_name $file
+ done
+}
+
+#
+# Compare the extended attributes of the files/dirs
+# b/w the dumped and restore dirs.
+#
+#
+# Attribute "attr5" had a 8 byte value for /spare1/dump.5460/dir:
+# Attribute "attr5" had a 8 byte value for /spare1/restore.5460/dump.5460/dir:
+#
+_diff_compare_eas()
+{
+ echo "Comparing dump directory with restore directory"
+ echo "Looking at the extended attributes (EAs)"
+ echo "EAs on dump"
+ _get_eas_on_path $dump_dir | tee $seq.ea1 | _dir_filter
+ echo "EAs on restore"
+ _get_eas_on_path $restore_dir/$dump_sdir \
+ | sed -e "s#$restore_sdir\/##" \
+ | tee $seq.ea2 \
+ | _dir_filter
+ diff -s $seq.ea1 $seq.ea2
}
+
#
# Compare using recursive diff the files of the dumped
# filesystem
{
host=`hostname`
echo "xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT \"$middate\" $*" >$seq.full
- xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT "$middate" $* \
+ xfsinvutil $_invutil_debug $* -M $host:$SCRATCH_MNT "$middate" \
| tee -a $seq.full | _invutil_filter
}