Created
November 25, 2022 11:45
-
-
Save bergpb/a286b792cc762d3487a6430c53707657 to your computer and use it in GitHub Desktop.
Test disk speed using dd
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 | |
local=$1 | |
size=$2 | |
if [[ ! -n $local ]]; then | |
echo "Variable local not set, default will be /tmp/test_disk_speed" | |
local='/tmp/test_disk_speed' | |
fi | |
if [[ ! -n $size ]]; then | |
echo "Variable size not set, default will be 1000" | |
size=500 | |
fi | |
echo "Testing writing speed..." | |
sync; dd if=/dev/zero of=$local bs=1M count=$size; sync | |
echo "Testing reading speed..." | |
sync; dd if=$local of=/dev/zero bs=1M count=$size; sync | |
rm $local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment