- [ -z "`which iozone 2> /dev/null`" ] && log "iozone missing" && return
- FREE=`df -P -h $DIR | tail -n 1 | awk '{ print $3 }'`
- case $FREE in
- *T|*G) FREE=1G;;
- esac
- IOZONE_OPTS="-i 0 -i 1 -i 2 -+d -r 4 -s $FREE"
- iozone $IOZONE_OPTS -f $DIR/$tfile &
- PID=$!
-
+ [ -z "`which iozone 2> /dev/null`" ] && skip_env "iozone missing" && return 0
+
+ # striping is -c 1, get min of available
+ local minavail=$(lctl get_param -n osc.*[oO][sS][cC][-_]*.kbytesavail | sort -n | head -1)
+ local size=$(( minavail * 3/4 ))
+ local GB=1048576 # 1048576KB == 1GB
+
+ if (( size > GB )); then
+ size=$GB
+ fi
+ local iozone_opts="-i 0 -i 1 -i 2 -+d -r 4 -s $size -f $TDIR/$tfile"
+
+ iozone_bg $iozone_opts &
+ local pid=$!
+
+ echo iozone bg pid=$pid
+