How do I verify that my hosting provider gave me SSDs?
I searched and found 2 options, none of which I'm confident provided me the answer.
1: cat /sys/block/sda/queue/rotational
This output '1' to stdout. What does this mean?
2: lshw -class disc
but couldn't find anything that answers my question.
Let's try to read 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
This is something that should be very slow on rotating drive in comparison with SSD. On my desktop class SSD it ends in about a second. On desktop class 7200rpm rotating drive it ends in 10 seconds.
In a physical machine (not a VPS), you can get the type with smartctl
:
smartctl -a /dev/sda
and grep for Rotation
:
smartctl -a /dev/sda | grep Rotation
Rotation Rate: Solid State Device
smartctl -a /dev/sdb | grep Rotation
Rotation Rate: 5400 rpm
It's quite likely you have no chance to identify the disk type inside a VPS, as the hypervisor abstracts the real hardware away from the guest machines.