How to know if I have an SSD drive or HDD?

Sometimes our dedicated servers come with Solid State Drives, but… how can you really know that what’s inside your box is an SSD or a HDD drive? On this post you will find ways to know if I have an SSD drive or HDD running inside my box.

As we all know, SSD drives are really well in terms of speed for our Linux servers. Are a little bit expensive than SATA, but they provide excellent performance 10x times better than SATA on most cases.

But how can I know if I have an SSD drive or HDD?

Since kernel version 2.6.29 you can check if your drive is a fast solid state drive or HDD using the following command:

cat /sys/block/sda/queue/rotational

If you get 1 then it’s a hard disk.

If you get 0 then it’s an solid state drive.

Alternative way to determine if drive is SSD or HDD

smartctl is the traditional disk health tool for all system administrators used to check disk health issues, but it can also help to retrieve the disk vendor details. Let’s run smartctl to get the type of HDD that you have:

smartctl -a /dev/sda

Expected ouput:

root@localhost ~]# smartctl -a /dev/sda
smartctl 6.4 2015-06-04 r4109 [x86_64-linux-4.4.7-300.fc23.x86_64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SanDisk based SSDs
Device Model:     SanDisk SDSSDP128G
Serial Number:    130773402659
LU WWN Device Id: 5 001b44 97e48c023
Firmware Version: 2.0.0
User Capacity:    128.035.676.160 bytes [128 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device

If you see this line “Rotation Rate: Solid State Device” then you haven an Solid State Drive.

If smartctl command is not found, try installing it using this command:

yum install smartmontools -y

Conclusion

As you see, it’s easy to know if I you have an SSD or HDD drive. If you know other ways to verify this kind of stuff, please let us know so we can add that information into the post.

About the Author: Martin Keler

Leave a Reply

Your email address will not be published. Required fields are marked *