Created
October 30, 2020 18:01
-
-
Save gma/0bf79da9d8105d7d3b49f4f18dd246dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
GIGABYTES="${1:-1}" | |
ITERATIONS="${2:-1}" | |
MOUNT="/mnt/tank" | |
sshhh() { | |
grep -v "+0 records" | |
} | |
for i in $(seq $ITERATIONS); do | |
FILE="$MOUNT/${GIGABYTES}GB" | |
echo -n "Writing: " | |
sudo dd if=/dev/zero of="$FILE" count=$GIGABYTES bs=1G oflag=dsync 2>&1 | sshhh | |
echo -n "Reading: " | |
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null | |
dd if="$FILE" of=/dev/null bs=8k 2>&1 | sshhh | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment