方法1:
如果是直通盘,即JBOD模式,方法则正确
如果返回1则表示磁盘可旋转,那么就是HDD了;
反之,如果返回0,则表示磁盘不可以旋转,那么就有可能是SSD了
[cheshi@cheshi-laptop2 ~]$ cat /sys/block/nvme0n1/queue/rotational
0
方法2:lsblk命令进行判断,参数-d表示显示设备名称,参数-o表示仅显示特定的列,前提也是直通盘则没问题
[cheshi@cheshi-laptop2 ~]$ lsblk -d -o name,rota
NAME ROTA
nvme0n1 0
[cheshi@cheshi-laptop2 ~]$
方法3:smartctl,万能方法,但是smartctl若没有则GG
smartctl -a /dev/sda | grep 'Rotation Rate'
If the disk is HDD, the output will be as:
Rotation Rate: 5400 rpmIf the disk is SSD, output will look like:
Rotation Rate: Solid State Device
http://www.taodudu.cc/news/show-5528414.html?action=onClick