October 5, 2025

How to Identify SSD and HDD in a Linux Server

mr rockstar

How to Identify SSD and HDD in a Linux Server
Cheap Dedicated Server

When managing a Linux server, it’s important to know whether your storage devices are SSD (Solid State Drive) or HDD (Hard Disk Drive). SSDs are faster and more reliable, while HDDs provide larger capacity at a lower cost. Knowing the type helps with performance tuning, troubleshooting, and capacity planning.

Methods to Check SSD or HDD in Linux

1. Using lsblk

Run:
Using lsblk

lsblk -o NAME,ROTA,TYPE,SIZE,MOUNTPOINT
  • ROTA = 0 → SSD (non-rotational).
  • ROTA = 1 → HDD (rotational).

2. Using cat on sysfs

Check if a disk is rotational:
Using cat on sysfs

cat /sys/block/sdX/queue/rotational
  • 0 = SSD
  • 1 = HDD

Replace sdX with your device name (e.g., sda).

3. Using smartctl

First, install smartmontools:

sudo apt install smartmontools   # Debian/Ubuntu  
sudo yum install smartmontools   # RHEL/CentOS  

Then run:
Using smartctl

sudo smartctl -i /dev/sdX

It will show detailed device info, often including whether it’s an SSD.

4. Using dmesg Logs

Run:
Using dmesg Logs

dmesg | grep -i 'sd'

This sometimes reveals the drive type during boot messages.


 

How to Identify SSD and HDD in a Linux Server (F.A.Q)

How can I quickly check if my disk is SSD or HDD in Linux?

Use lsblk -o NAME,ROTA — if ROTA=0, it’s an SSD; if ROTA=1, it’s an HDD.

 

 

Do all SSDs show as ROTA=0?

Yes, by default SSDs are non-rotational, so Linux marks them with ROTA=0.

Can I use GUI tools to check disk type?

Yes, tools like gnome-disks or KDE Partition Manager can also show disk type.

Why is it important to know if a disk is SSD or HDD?

Because SSDs are faster and better for performance-critical tasks, while HDDs are more suitable for bulk storage.

Popular Blog Posts