Skip to content

Instantly share code, notes, and snippets.

@ChristianWilkie
Last active July 5, 2024 06:34
Show Gist options
  • Save ChristianWilkie/b450783afea4e666fb2e1c16e34e7e1d to your computer and use it in GitHub Desktop.
Save ChristianWilkie/b450783afea4e666fb2e1c16e34e7e1d to your computer and use it in GitHub Desktop.
raspberry pi disk speed script
#!/bin/bash
# Tests Raspberry Pi disk read/write speed
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
echo "=== Performing Write Speed Test ==="
dd if=/dev/zero of=/tmp/test.tmp bs=500K count=1024 oflag=dsync
sync; echo 3 | tee /proc/sys/vm/drop_caches
echo "=== Performing Read Speed Test ==="
dd if=/tmp/test.tmp of=/dev/null bs=500K count=1024
rm -rf /tmp/test.tmp
echo "=== Speed Test Complete ==="
@liaoya
Copy link

liaoya commented Jul 5, 2024

This only measure memory speed since it write /tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment