How to check if the disk is SSD?

Most of the data centers and hosting providers are now offering SSD (Solid-state drive). If you run the fdisk command to check the drives it’s still going to show as sda/hda. Since kernel 2.6.29 Linux automatically detects SSD. Now to verify sda for SDD. Simple cat the /sys/block/sda/queue/rotational file. If the output is “0” then that  means it’s a SSD.

root@host [~]# cat /sys/block/sda/queue/rotational
root@host [~]#

If the result is
1 -> Regular SATA disk
0 -> SDD