3
# take the path of the storage device and test is it a block device.
5
function run_bonnie() {
6
echo "Running bonnie++ on $1..."
8
# Determine where to put the scratchdisk
9
mount_point=$(df -h | grep $1 | awk '{print $6}')
10
echo "Putting scratch disk at $mount_point"
11
mkdir -p "$mount_point/tmp/scratchdir"
12
bonnie++ -d "$mount_point/tmp/scratchdir" -u root
19
echo "$disk is a block device"
20
size=`parted -l | grep $disk | awk '{print $3}'`
24
echo "$disk reports a size of $size."
25
# Have to account for the end of the size descriptor
26
size_range=${size:(-2)}
28
if [ $size_range == "KB" ]
30
echo "$disk is too small to be functioning."
32
elif [ $size_range == "MB" ]
34
size_int=${size::${#size}-2}
36
if [ $size_int -gt 10 ]
40
echo "$disk is too small to be functioning."
47
echo "$disk doesn't report a size."
51
echo "$disk is not listed as a block device."