this simple shell script tests the write speed of a block device.
it splits the device into $NUM_TESTS
parts and writes $WRITE_SIZE_IN_MB
data at each location using dd
. then it does a last write test at the very end of the device.
it can be used to print the write speed of the device on its whole range instead of just the beginning, like what a typical dd
would do. this is important for e.g. HDDs, where the speed usually decreases at the end, because of the constant angular velocity but varying bit "density".
the first couple of lines define the default values for some arguments, and they can be overridden by invoking the script like this:
NUM_TESTS=3 WRITE_SIZE_IN_MB=10 ./block_device_multiple_dd_write_test.sh /dev/sdX