tidy mkfs parameterisation, -f option pulled into common.rc.

This commit is contained in:
fsgqa
2002-05-06 07:44:22 +00:00
parent fe932fdad3
commit f29425d6f7
29 changed files with 94 additions and 108 deletions
+44 -52
View File
@@ -35,7 +35,7 @@
#
# --- initializations ---
rm -f $seq.full
rm -f $here/$seq.full
if [ -n "$DEBUGDUMP" ]; then
_dump_debug=-v5
@@ -81,16 +81,8 @@ for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
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
have_mtvariable=false
[ `uname` = "Linux" ] && have_mtvariable=true
#
# do a remote/local mt
@@ -122,7 +114,7 @@ _check_onl()
_limit=10
i=0
while [ $i -lt $_limit ]; do
echo "Checking online..." >>$seq.full
echo "Checking online..." >>$here/$seq.full
if _mt status >$tmp.status 2>&1; then
break;
else
@@ -156,12 +148,12 @@ _check_onl()
_wait_tape()
{
echo "Wait for tape, $dumptape, ..." >>$seq.full
echo "Wait for tape, $dumptape, ..." >>$here/$seq.full
i=0
while [ $i -lt 20 ]; do
echo "Checking status..." >>$seq.full
if _mt status 2>&1 | tee -a $seq.full | egrep -i "onl|ready" >/dev/null; then
echo "Checking status..." >>$here/$seq.full
if _mt status 2>&1 | tee -a $here/$seq.full | egrep -i "onl|ready" >/dev/null; then
break;
else
sleep 2
@@ -175,7 +167,7 @@ _wait_tape()
#
_rewind()
{
echo "Initiate rewind..." >>$seq.full
echo "Initiate rewind..." >>$here/$seq.full
_wait_tape
_mt rewind >/dev/null
_wait_tape
@@ -188,7 +180,7 @@ _rewind()
#
_erase_soft()
{
echo "Erasing tape" | tee -a $seq.full
echo "Erasing tape" | tee -a $here/$seq.full
_rewind
_mt weof 3
_rewind
@@ -196,7 +188,7 @@ _erase_soft()
_erase_hard()
{
echo "Erasing tape" | tee -a $seq.full
echo "Erasing tape" | tee -a $here/$seq.full
_mt erase
}
@@ -238,8 +230,8 @@ _require_tape()
_error()
{
echo "Error: $*" | tee -a $seq.full
echo "(see $seq.full for details)"
echo "Error: $*" | tee -a $here/$seq.full
echo "(see $here/$seq.full for details)"
status=1
exit
}
@@ -248,10 +240,10 @@ _wipe_fs()
{
_require_scratch
mkfs_xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full ||\
mkfs_xfs $SCRATCH_DEV>>$here/$seq.full ||\
_error "mkfs failed"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\
_error "mount failed"
}
@@ -297,9 +289,9 @@ _cleanup()
_stable_fs()
{
_saveddir=`pwd`; cd /
umount $SCRATCH_MNT >>$seq.full ||\
umount $SCRATCH_MNT >>$here/$seq.full ||\
_error "unmount failed"
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\
_error "mount failed"
cd $_saveddir
}
@@ -330,12 +322,12 @@ _create_dumpdir_stress()
echo "-----------------------------------------------"
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"
echo " fsstress (count=$_count) returned $? - see $here/$seq.full"
echo "--------------------------------------" >>$here/$seq.full
echo "output from fsstress:" >>$here/$seq.full
echo "--------------------------------------" >>$here/$seq.full
cat $tmp.out >>$here/$seq.full
echo "--------------------------------------" >>$here/$here/$seq.full
echo "output from fsstress:" >>$here/$here/$seq.full
echo "--------------------------------------" >>$here/$here/$seq.full
cat $tmp.out >>$here/$here/$seq.full
status=1
fi
@@ -899,7 +891,7 @@ _do_dump_sub()
echo "Dumping to tape..."
opts="$_dump_debug$dump_args -s $dump_sdir -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
echo "xfsdump $opts" | _dir_filter
xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
#
@@ -912,7 +904,7 @@ _do_dump()
echo "Dumping to tape..."
opts="$_dump_debug$dump_args -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
echo "xfsdump $opts" | _dir_filter
xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
@@ -927,7 +919,7 @@ _do_dump_min()
onemeg=1048576
opts="$_dump_debug$dump_args -m -b $onemeg -l0 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
echo "xfsdump $opts" | _dir_filter
xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
@@ -941,7 +933,7 @@ _do_dump_file()
echo "Dumping to file..."
opts="$_dump_debug$dump_args -f $dump_file -M $media_label -L $session_label $SCRATCH_MNT"
echo "xfsdump $opts" | _dir_filter
xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
#
@@ -963,7 +955,7 @@ _do_dump_multi_file()
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
xfsdump $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
@@ -998,7 +990,7 @@ _do_restore()
echo "Restoring from tape..."
opts="$_restore_debug -f $dumptape -L $session_label $restore_dir"
echo "xfsrestore $opts" | _dir_filter
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
#
@@ -1013,7 +1005,7 @@ _do_restore_min()
onemeg=1048576
opts="$_restore_debug -m -b $onemeg -f $dumptape -L $session_label $restore_dir"
echo "xfsrestore $opts" | _dir_filter
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
#
@@ -1027,7 +1019,7 @@ _do_restore_file()
echo "Restoring from file..."
opts="$_restore_debug -f $dump_file -L $session_label $restore_dir"
echo "xfsrestore $opts" | _dir_filter
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
#
@@ -1044,7 +1036,7 @@ _do_restore_file_cum()
echo "Restoring cumumlative from file..."
opts="$_restore_debug -f $dump_file -r $restore_dir"
echo "xfsrestore $opts" | _dir_filter
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
_do_restore_toc()
@@ -1053,7 +1045,7 @@ _do_restore_toc()
opts="$_restore_debug -f $dump_file -t"
echo "xfsrestore $opts" | _dir_filter
cd $SCRATCH_MNT # for IRIX which needs xfs cwd
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter_main |\
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter_main |\
_check_quota_file |\
_check_quota_entries |\
$AWK_PROG 'NF != 1 { print; next }
@@ -1084,7 +1076,7 @@ _do_restore_multi_file()
echo "Restoring from file..."
opts="$_restore_debug $multi_args -L $session_label $restore_dir"
echo "xfsrestore $opts" | _dir_filter
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
xfsrestore $opts 2>&1 | tee -a $here/$seq.full | _dump_filter
}
#
@@ -1100,7 +1092,7 @@ _do_dump_restore()
restore_opts="$_restore_debug - $restore_dir"
dump_opts="$_dump_debug$dump_args -s $dump_sdir - $SCRATCH_MNT"
echo "xfsdump $dump_opts | xfsrestore $restore_opts" | _dir_filter
xfsdump $dump_opts 2>$tmp.dump.mlog | xfsrestore $restore_opts 2>&1 | tee -a $seq.full | _dump_filter
xfsdump $dump_opts 2>$tmp.dump.mlog | xfsrestore $restore_opts 2>&1 | tee -a $here/$seq.full | _dump_filter
_dump_filter <$tmp.dump.mlog
}
@@ -1116,8 +1108,8 @@ _ls_compare_sub()
# verify we got back what we dumped
#
echo "Comparing listing of dump directory with restore directory"
ls -lR $dump_dir | tee -a $seq.full | _ls_filter >$tmp.dump_dir
ls -lR $restore_dir/$dump_sdir | tee -a $seq.full | _ls_filter \
ls -lR $dump_dir | tee -a $here/$seq.full | _ls_filter >$tmp.dump_dir
ls -lR $restore_dir/$dump_sdir | tee -a $here/$seq.full | _ls_filter \
| sed -e "s#$restore_sdir\/##" >$tmp.restore_dir
diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
@@ -1139,8 +1131,8 @@ _ls_nodate_compare_sub()
# verify we got back what we dumped
#
echo "Comparing listing of dump directory with restore directory"
ls -lR $dump_dir | tee -a $seq.full | _ls_filter | _ls_nodate_filter >$tmp.dump_dir
ls -lR $restore_dir/$dump_sdir | tee -a $seq.full | _ls_filter \
ls -lR $dump_dir | tee -a $here/$seq.full | _ls_filter | _ls_nodate_filter >$tmp.dump_dir
ls -lR $restore_dir/$dump_sdir | tee -a $here/$seq.full | _ls_filter \
| _ls_nodate_filter | sed -e "s#$restore_sdir\/##" >$tmp.restore_dir
diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
@@ -1201,13 +1193,13 @@ _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
_get_eas_on_path $dump_dir | tee $here/$seq.ea1 | _dir_filter
echo "EAs on restore"
_get_eas_on_path $restore_dir/$dump_sdir \
| sed -e "s#$restore_sdir\/##" \
| tee $seq.ea2 \
| tee $here/$seq.ea2 \
| _dir_filter
diff -s $seq.ea1 $seq.ea2
diff -s $here/$seq.ea1 $here/$seq.ea2
}
@@ -1226,7 +1218,7 @@ _diff_compare()
#
_dump_inventory()
{
xfsdump $_dump_debug -I | tee -a $seq.full | _dump_filter_main
xfsdump $_dump_debug -I | tee -a $here/$seq.full | _dump_filter_main
}
#
@@ -1236,9 +1228,9 @@ _dump_inventory()
_do_invutil()
{
host=`hostname`
echo "xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT \"$middate\" $*" >$seq.full
echo "xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT \"$middate\" $*" >$here/$seq.full
xfsinvutil $_invutil_debug $* -M $host:$SCRATCH_MNT "$middate" \
| tee -a $seq.full | _invutil_filter
| tee -a $here/$seq.full | _invutil_filter
}
#
@@ -1254,7 +1246,7 @@ _check_quota()
$here/src/feature -U $SCRATCH_DEV && uquota=1
$here/src/feature -G $SCRATCH_DEV && gquota=1
$AWK_PROG -v uquota=$uquota -v gquota=$gquota -v full=$seq.full \
$AWK_PROG -v uquota=$uquota -v gquota=$gquota -v full=$here/$seq.full \
-v usermsg="$usermsg" -v groupmsg="$groupmsg" '
$0 ~ groupmsg {
print "Found group quota:", $0 >>full