Linux下如何确认磁盘是否为SSD

时间:2017-07-06 00:26:55   收藏:0   阅读:2708

方法

法1:通过查看/sys/block/sda/queue/rotational

通过cat /sys/block/sda/queue/rotational进行查看,返回值0即为SSD;返回1即为HDD。

 

法2:通过lsscsi查看

lsscsi - list SCSI devices (or hosts) and their attributes

实例

HDD

[root@ssd-test thatsit]# cat /sys/block/sda/queue/rotational
1
[root@ssd-test thatsit]# lsscsi
[0:0:32:0] enclosu DP BP12G+ 1.00 -
[0:2:0:0] disk DELL PERC H310 2.12 /dev/sda
[root@ssd-test thatsit]#

SSD

[root@hdd-test thatsit]# cat /sys/block/sda/queue/rotational
0
[root@hdd-test thatsit]# lsscsi
[0:0:0:0] disk ATA INTEL SSDSC2BX48 0150 -
[0:0:1:0] disk ATA INTEL SSDSC2BX48 0150 -
[0:1:0:0] disk LSI Logical Volume 3000 /dev/sda
[root@hdd-test thatsit]#

  

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!