#!/bin/bash

##
## 128k
##
echo "Testing 128k bs"

echo 'time sh -c "dd if=/dev/zero of=ddfile1 bs=128k count=262144 && sync"'
time sh -c "dd if=/dev/zero of=ddfile1 bs=128k count=262144 && sync"

echo 'dd if=/dev/zero of=ddfile2 bs=128k count=131072'
dd if=/dev/zero of=ddfile2 bs=128k count=131072

echo 'time dd if=ddfile1 of=/dev/null bs=128k'
time dd if=ddfile1 of=/dev/null bs=128k

rm ddfile1 ddfile2

##
## 64k
##
echo "Testing 64k bs"

echo 'time sh -c "dd if=/dev/zero of=ddfile3 bs=64k count=524288 && sync"'
time sh -c "dd if=/dev/zero of=ddfile3 bs=64k count=524288 && sync"

echo 'dd if=/dev/zero of=ddfile4 bs=64k count=262144'
dd if=/dev/zero of=ddfile4 bs=64k count=262144

echo 'dd if=ddfile3 of=/dev/null bs=64k'
time dd if=ddfile3 of=/dev/null bs=64k

rm ddfile3 ddfile4

##
## 8k
##
echo "Testing 8k bs"

echo 'time sh -c "dd if=/dev/zero of=ddfile5 bs=8k count=4194304 && sync"'
time sh -c "dd if=/dev/zero of=ddfile5 bs=8k count=4194304 && sync"

echo 'dd if=/dev/zero of=ddfile6 bs=8k count=2097152'
dd if=/dev/zero of=ddfile6 bs=8k count=2097152

echo 'time dd if=ddfile5 of=/dev/null bs=8k'
time dd if=ddfile5 of=/dev/null bs=8k

rm ddfile5 ddfile6