I needed to do this on the VPS and none of the provided solutions worked for me,
but this answer did the trick:
so, it is about readingThis just reads random data from the drive and assessingassesses the time.
time for i in `seq 1 1000`; do
dd bs=4k if=/dev/sda count=1 skip=$(( $RANDOM * 128 )) >/dev/null 2>&1;
done
hereNOTE: You may need sudo
before the dd
command, depending on your permissions.
Here are my results for an SSD:
real 0m1.375s
user 0m0.285s
sys 0m0.944s
andAnd a HDD:
real 0m14.249s
user 0m0.752s
sys 0m6.284s
As you can see, the HDD takes about 10x the duration. This may not be reliable for some very fast HDD's, but in general, it will give you a good idea.