首页 > 代码库 > Linux 查看硬盘是否为SSD(固态硬盘)

Linux 查看硬盘是否为SSD(固态硬盘)

 
以下转自百度:
最近在准备测试,需要看看哪些机器挂载的是ssd硬盘,Google了一圈看到了许多方法,但都云里雾里的,不知道怎么确定。ssd硬盘貌似使用的也是scsi接口,所以根据盘符的名称也是判断不出来的。最后群里eric大神告知lsscsi工具,试了一下,非常简单,显示的也很直接,分享一下。
废话不多说,直接上图和结果,如下所示:
[root@FWD_YF_009_110 ~]# lsscsi
[0:0:0:0] disk SEAGATE ST3300657SS ES62 - 
[0:0:1:0] disk ATA INTEL SSDSA2CW16 0362 /dev/sda
[0:0:2:0] disk ATA INTEL SSDSA2CW16 0362 /dev/sdb
[0:0:3:0] disk ATA INTEL SSDSA2CW16 0362 /dev/sdc
[0:1:0:0] disk Dell VIRTUAL DISK 1028 /dev/sdd
[3:0:0:0] cd/dvd TEAC DVD-ROM DV-28SW R.2A /dev/sr0

看第四列就知道是否是SSD硬盘了,感兴趣的可以试下

 

附其他查看信息:

1、lshw查看所有硬件摘要信息

下面命令可以查看所有硬件摘要信息,并输出成一个html文件,把此html文件导出到电脑上,直接打开,可以清楚的看到硬件信息:

[root@localhost /]# lshw -html > /hardware.html

2、lsscsi查看SCSI控制器设备的信息

可以看到Raid卡信息和所有虚拟磁盘以及光驱的信息,如果没有硬件SCSI控制器,那就不会返回信息:

[root@localhost /]# lsscsi
[0:2:0:0]    disk    DELL     PERC H730P Mini  4.27  /dev/sda
[0:2:1:0]    disk    DELL     PERC H730P Mini  4.27  /dev/sdb
[0:2:2:0]    disk    DELL     PERC H730P Mini  4.27  /dev/sdc
[10:0:0:0]   cd/dvd  PLDS     DVD+-RW DS-8ABSH LD51  /dev/sr0

3、lscpu查看CPU信息

[root@localhost /]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    1
Core(s) per socket:    8
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 79
Model name:            Intel(R) Xeon(R) CPU E5-2609 v4 @ 1.70GHz
Stepping:              1
CPU MHz:               1699.930
BogoMIPS:              3399.52
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15

4、lsusb查看USB接口设备信息

[root@localhost /]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:800a Intel Corp.
Bus 002 Device 002: ID 8087:8002 Intel Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 04d9:1603 Holtek Semiconductor, Inc. Keyboard
Bus 003 Device 003: ID 045e:0084 Microsoft Corp. Basic Optical Mouse
Bus 003 Device 004: ID 413c:a001 Dell Computer Corp. Hub

5、lsblk查看块设备信息

[root@localhost /]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  200G  0 disk
├─sda1   8:1    0    2G  0 part /boot
├─sda2   8:2    0  127G  0 part /
└─sda3   8:3    0 62.5G  0 part [SWAP]
sdc      8:32   0  223G  0 disk
└─sdc1   8:33   0  223G  0 part /oldstore
sdb      8:16   0 21.1T  0 disk
└─sdb1   8:17   0 21.1T  0 part /store
sr0     11:0    1 1024M  0 rom

Linux 查看硬盘是否为SSD(固态硬盘)