#!/bin/bash
#ARGS 
# $1 starting device #
# $2 num devices
# $3 fstype 
# $4 iosize in MB

#if [ $1 == "/dev/sda" -o $1 == "/dev/sdb" ]
if [ $1 == "1" ]
then
	echo ABORTING - restricted drive specified
	exit 1
fi
#note, doesn't handle starting drive above sdz
if [ $1 -gt "26" ]
then
	echo ABORTING - unknown drive specified
	exit 1
fi

dev="/dev/sd"
rawdev="/dev/raw/raw"

x=97
y=97
let x=x+$1-1
let end=$1+$2
for ((i=$1 ; i< $end; i++))
do
        y2=`echo $x | awk '{printf "%c",$1}'`
        let x=x+1
        #echo $dev$y1$y2
	./mkmount$3 $dev$y1$y2 /mnt/mnt$i
	dd if=/dev/zero of=/mnt/mnt$i/foo count=$4 bs=1024k
	umount /mnt/mnt$i
	#mount $dev$y1$y2 /mnt/mnt$i

        if [ "$y2" == 'z' ]; then
                if [ "$y1" != "" ]; then
                        let y=y+1
                        y1=`echo $y | awk '{printf "%c",$1}'`
                else
                        y1='a'
                fi
                x=97
        fi
done
