The disks in the computer can be roughly divided into Hard Disk Drive (HDD) and Solid State Drive (SSD).
Disk Type | Description |
---|---|
HDD | cheap, light and slow in reading and writing |
SSD | expensive, heavy, and fast in reading and writing |
But if they are mount on computer, you can use the terminal without disassembling the hardware device to determind what kind of hard disk is.
Let's see how to judge it below!
How to Determine
If fact, you only need to use the cat
command to print out the rotational information.
cat /sys/block/"your_device"/queue/rotational
The reason is simple, SSD does not require the rotation of the mechanical structure like HDD, but directly uses chip addressing.
Therefore, if the information of rotational is 0, it means that the disk is SSD; otherwise, if 1 is printed, it means HDD
But be careful, sometimes there may be more than one or two devices mounted on our computer, which requires careful confirmation. For example, my own device:
But we don't need to care about them at the moment; take my computer as an example, what we really want to check are the two disk nvme0n1 and sda.
cat /sys/block/nvme0n1/queue/rotational
Output:
0
It is SSD.
cat /sys/block/sda/queue/rotational
Output:
1
It is HDD.