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.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityI 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.
real 0m1.632s user 0m0.336s sys 0m0.939s
it mean i am on ssd?
dd: failed to open ‘/dev/sdb’: Permission denied
Apr 20, 2020 at 7:13
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.
bonnie++
etc.