#!/bin/sh DISK="$1" FS="$2" MNT="$3" OPT="$4" LOG="${FS}" if [ -n "$OPT" ]; then LOG="${LOG}_${OPT}" fi LOG="${LOG}.txt" function usage () { ssh -i id_rsa root@phenom \ 'du /vmfs/volumes/datastore1/test1/test1-flat.vmdk' >> "$LOG" } [ -z "$MNT" ] && { echo "usage: $0 []" >&2; exit 1; } usage fdisk "$DISK" || exit 1 usage mkfs."$FS" "${DISK}1" || exit 1 usage mount "${DISK}1" "$MNT" || exit 1 usage sleep 120 usage count=100 for i in {1..300}; do dd if=/dev/zero of="$MNT"/bla.img bs=1024k count=$count oflag=direct if [ "$OPT" = "rm" ]; then rm -f "$MNT"/bla.img fi if [ "$OPT" = "sync" ]; then sync fi if [ "$OPT" = "unmount" ]; then umount "$MNT" || exit 1 fi if [ "$OPT" = "unmount50" -a $((i%50)) -eq 0 ]; then umount "$MNT" || exit 1 fi if [ "$OPT" = "increase50" -a $((i%50)) -eq 0 ]; then umount "$MNT" || exit 1 fi usage if [ "$OPT" = "unmount" ]; then mount "${DISK}1" "$MNT" || exit 1 fi if [ "$OPT" = "unmount50" -a $((i%50)) -eq 0 ]; then mount "${DISK}1" "$MNT" || exit 1 fi if [ "$OPT" = "increase50" -a $((i%50)) -eq 0 ]; then mount "${DISK}1" "$MNT" || exit 1 fi if [ "$OPT" = "increase50" -a $((i%100)) -eq 0 ]; then count=$((count+100)) fi done scp "$LOG" fjo@core:/data/fjo/results/