5 TESTLOG_PREFIX=${TESTLOG_PREFIX:-$TMP/recovery-mds-scale}
6 TESTNAME=${TESTNAME:-""}
7 [ -n "$TESTNAME" ] && TESTLOG_PREFIX=$TESTLOG_PREFIX.$TESTNAME
9 LOG=$TESTLOG_PREFIX.$(basename $0 .sh)_stdout.$(hostname -s).log
10 DEBUGLOG=$(echo $LOG | sed 's/\(.*\)stdout/\1debug/')
18 . $(dirname $0)/functions.sh
20 assert_env MOUNT END_RUN_FILE LOAD_PID_FILE LFS CLIENT_COUNT
24 # recovery-*-scale scripts use this to signal the client loads to die
25 echo $$ >$LOAD_PID_FILE
27 TESTDIR=$MOUNT/d0.dd-$(hostname)
30 while [ ! -e "$END_RUN_FILE" ] && $CONTINUE; do
31 echoerr "$(date +'%F %H:%M:%S'): dd run starting"
33 $LFS setstripe -c -1 $TESTDIR
37 # suppress dd xfer stat to workaround buggy coreutils/gettext
38 # combination in RHEL5 and OEL5, see BZ 21264
39 FREE_SPACE=$(df -P $TESTDIR | awk '/:/ { print $4 }')
40 BLKS=$((FREE_SPACE * 9 / 40 / CLIENT_COUNT))
41 echoerr "Total free disk space is $FREE_SPACE, 4k blocks to dd is $BLKS"
44 dd bs=4k count=$BLKS status=noxfer if=/dev/zero of=$TESTDIR/dd-file \
47 echoerr "$(date +'%F %H:%M:%S'): dd succeeded"
50 echoerr "$(date +'%F %H:%M:%S'): dd run finished"
52 echoerr "$(date +'%F %H:%M:%S'): dd failed"
53 if [ -z "$ERRORS_OK" ]; then
54 echo $(hostname) >> $END_RUN_FILE
56 if [ $BREAK_ON_ERROR ]; then
63 echoerr "$(date +'%F %H:%M:%S'): dd run exiting"