How to tell if a running disk drive is a SSD or hdisk?

This question is dummy if you can easily open your server to have a look, however, sometime you want to know when system is on the fly, how to tell?

Surely, disk size, probably is a clear indication tells you if it's a SSD or HDD. because HDD usually is much bigger than SSD, however, in nowadays, SSD is getting larger too. So, how do we distingush SSD and HDD on the fly?

Linux automatically detects SSD, and since kernel version 2.6.29, you may verify sde with:

info from sysfs

# cat /sys/block/sde/queue/rotational 
1

You should get 1 for hard disks and 0 for a SSD.

lsblk

# lsblk -d -o name,hctl,rota 
NAME HCTL       ROTA
sda  0:0:0:0       1
sdb  0:0:1:0       1
sdc  0:0:2:0       1

1 for hard disks and 0 for a SSD.

For some confusion products

Above ways may not work for some deviceS, such as Hybrid Drive, in most of cases, dual-drive hybrids show up as two individual drives, where SSHD (Solid-State Hybrid Drive) shows up as a single drive. So, the SSHD would show rotational of 1.

What happens if you are not sure? The steps below help you identify the disk mode/product first, then good it out

Get the disk product info from scsi info

cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E

Don't know how to identify from this file to actual device ?

use lsblk or lsscsi to identify each device H:C:T:L

# lsblk -d -o name,hctl
sda  0:0:0:0 
...
This device maps to scsi0 Channel:00 id:00 lun:0

So, you get this disk model : seagate ST31000N, then google it, get its detail info

sginfo

Another way to get disk product info

# sginfo -i /dev/sde | grep -i product
Product:                   HITACHI HUA7210S