This is one of those random things I do and decided to put it in the website. I know that my personal computer is running on HDD, but when I am logged into a remote Linux system and suddenly I started wondering about how to determine if the underlying disk is SSD or HDD, I wasn’t too sure what to look for. A quick Google search returned the best possible solution and I thought, hey maybe I should just write a small How to about “How to determine if a disk is SSD or HDD”.
Hard Disk Drive (HDD)
A hard disk drive (HDD) is a data storage device used for storing and retrieving digital information using rapidly rotating disks (platters) coated with magnetic material. An HDD retains its data even when powered off. Data is read in a random-access manner, meaning individual blocks of data can be stored or retrieved in any order rather than sequentially. An HDD consists of one or more rigid (“hard”) rapidly rotating disks (platters) with magnetic heads arranged on a moving actuator arm to read and write data to the surfaces.
Solid State Drive (SSD)
A solid-state drive (SSD) (also known as a solid-state disk or electronic disk, though it contains no actual disk, nor a drive motor to spin a disk) is a data storage device that uses integrated circuit assemblies as memory to store data persistently. SSD technology uses electronic interfaces compatible with traditional block input/output (I/O) hard disk drives, thus permitting simple replacement in common applications. Additionally, new I/O interfaces, like SATA Express, have been designed to address specific requirements of the SSD technology.
I wonder why I get back a 1 when I most definitely have an SSD. I am running Kali in VirtualBox, but I would imagine that it could still tell what type the underlying drive is. I guess not though, there must be something about the virtualization that disguises it as an HDD.
I am no expert, but my guess is that the guest has no knowledge whatsoever of your real hardware and the hypervisor is only presenting a virtual HD to it.
How to fix if you have a SSD and ‘cat /sys/block/sda/queue/rotational’ returns ‘1’ ?
I can’t imagine people asking these questions. It’s really visualization, make sure you have ran the same using the OS in the physical drive the least.
This has been proven invalid multiple times on multiple sites. Here’s a better way:
for x in
df | head -2 | tail -1 | awk {'print $1'} | sed s'/.$//'
; do smartctl -a $x | grep “Rotation Rate” ;doneIf you get nothing, it’s an SSD or a VM. If you get a result, it’s a SATA/SCSI/SAS drive.
this will not display true information if ssd is on RAID 10, I’m using Dell R310 with builtin raid 10 with 4 ssd drives