Skip to content

Instantly share code, notes, and snippets.

@hanvari
Last active August 3, 2017 15:20
Show Gist options
  • Save hanvari/f37ca6e1e0664fca49a5610923f75f02 to your computer and use it in GitHub Desktop.
Save hanvari/f37ca6e1e0664fca49a5610923f75f02 to your computer and use it in GitHub Desktop.
Benchmarking Disk access performance to detect SSD (or very high-speed HDD)
#reading 1000 random 4k blocks from first 16GB of a disk
time for i in `seq 1 1000`; do
dd bs=4k if=/dev/sda count=1 skip=$(( $RANDOM * 128 )) >/dev/null 2>&1;
done
#References:
# https://unix.stackexchange.com/questions/65595/how-to-know-if-a-disk-is-an-ssd-or-an-hdd
# https://serverfault.com/questions/551453/how-do-i-verify-that-my-hosting-provider-gave-me-ssds/551495#551495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment