Last active
February 6, 2019 11:09
-
-
Save hgomez/4539234 to your computer and use it in GitHub Desktop.
Sample HDD test script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
COUNT=2048 | |
BLOCKSIZE=1M | |
while getopts "c:b:" opt; do | |
case $opt in | |
c) | |
COUNT=$OPTARG | |
;; | |
b) | |
BLOCKSIZE=$OPTARG | |
;; | |
esac | |
done | |
echo "tests with $COUNT blocks of ${BLOCKSIZE}b" | |
echo | |
echo "testing pseudo-IO performances - 1st Pass" | |
dd if=/dev/zero of=/dev/null bs=$BLOCKSIZE count=$COUNT | |
echo | |
echo "testing IO write performances - 1st Pass" | |
dd if=/dev/zero of=PERFTEST bs=$BLOCKSIZE count=$COUNT oflag=direct | |
echo | |
echo "testing IO read performances - 1st Pass" | |
dd if=PERFTEST of=/dev/null bs=$BLOCKSIZE count=$COUNT | |
echo | |
echo "testing IO read performances - 2nd Pass" | |
dd if=PERFTEST of=/dev/null bs=$BLOCKSIZE count=$COUNT | |
echo | |
echo "testing IO write performances - 2nd Pass" | |
dd if=/dev/zero of=PERFTEST bs=$BLOCKSIZE count=$COUNT oflag=direct | |
rm -f PERFTEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment