Jut want to say thank you for your help. My final solution was:
Code:
#!/bin/bash
#used to set partition table to msdos and file system to fat16
#set function
reformat(){
#Make partition table
parted -s $1 mklabel "msdos"
#create partition and format it
parted -s $1 mkpartfs primary fat16 0 995
#output the partition information for verification
parted -s $1 print
}
#start of action
#create drive variable
vsd="/dev/sda"
#check drive exists
if [ -e $vsd ]
then
#run function
reformat $vsd
echo "done" $vsd
echo ""
else
#if drive doesn't exist
echo "nope $vsd doesnt exist"
fi
#end of action
I then copied and pasted the action section 6 more times and change the variable for each drive (sdb, sdc etc) as I new I only had 7 drives.
Before and after executing the above I did:
in a second terminal to check that the drive had registered and then that the partition had been created. Probably wasn't completely necessary but it gave me a double check.
It could probably have been a bit neater, however time wasn't on my side. But saying that, it solved my problem.