文章目录

  • ​​1.使用Linux相关命令​​
  • ​​2.linux查看磁盘所在槽位​​

1.使用Linux相关命令

  • 方法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 rpm

If the disk is SSD, output will look like:
Rotation Rate: Solid State Device

2.linux查看磁盘所在槽位

  • raid卡
    raid主要有LSI、Adaptec、Highpoint、Promise四家提供,其中前两家提供的最多。
    LSI现在属于博通公司。不同厂家使用命令工具不同。
    lsi阵列卡与pmc阵列卡;
可以通过lspci查看阵列卡信息:# lspci | grep LSI
17:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS3008 PCI-Express Fusion-MPT SAS-3 (rev 02)
68:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS3008 PCI-Express Fusion-MPT SAS-3 (rev 02)
  • SAS3IRCU工具查找SAS3008控制器
  • 下载安装sas3ircu
  • 不同操作系统下,SAS3IRCU工具的安装方法不同,此处仅以Windows、Linux、VMware为例进行说明,其他操作系统下的安装方法请参考软件包中的“Readme”文件。
    (1)登录​​BROADCOM网站上RAID卡​​的页面。
    (2)在“DOWNLOADS”页签中单击“Management Software and Tools”。打开管理软件和工具列表。
    (3)下载最新版本的“SAS3IRCU”工具。
    (4)解压后得到适用于不同操作系统的工具包。
  • 查看所有控制器
#./sas3ircu list
Avago Technologies SAS3 IR Configuration Utility.
Version 16.00.00.00 (2017.04.26)
Copyright (c) 2009-2017 Avago Technologies. All rights reserved.


Adapter Vendor Device SubSys SubSys
Index Type ID ID Pci Address Ven ID Dev ID
----- ------------ ------ ------ ----------------- ------ ------
0 SAS3008 1000h 97h 00h:17h:00h:00h 1000h 0097h

Adapter Vendor Device SubSys SubSys
Index Type ID ID Pci Address Ven ID Dev ID
----- ------------ ------ ------ ----------------- ------ ------
1 SAS3008 1000h 97h 00h:68h:00h:00h 1000h 0097h
SAS3IRCU: Utility Completed Successfully.
  • 据序列号查询磁盘所在槽位 (磁盘序列号可以根据disk/by-id查看,也可以通过后边smartctl查看)
# ll /dev/disk/by-id/ | grep sdm
lrwxrwxrwx 1 root root 9 8月 1 14:14 ata-ST8000NM0055-1RM112_ZA1CNVDK -> ../../sdm
lrwxrwxrwx 1 root root 9 8月 1 14:14 lvm-pv-uuid-J1WyJ6-4VkN-BPwC-Qcab-eUwZ-RfY1-Cq8x66 -> ../../sdm
lrwxrwxrwx 1 root root 9 8月 1 14:14 wwn-0x5000c500b2268d39 -> ../../sdm

# ./sas3ircu 0 display | grep ZA1CNVDK -A 3 -B 8
Enclosure # : 2
Slot # : 15
SAS Address : 5001c45-0-023d-bd8f
State : Ready (RDY)
Size (in MB)/(in sectors) : 7630885/15628053167
Manufacturer : ATA
Model Number : ST8000NM0055-1RM
Firmware Revision : SN05
Serial No : ZA1CNVDK
Unit Serial No(VPD) : ZA1CNVDK
GUID : 5000c500b2268d39
Protocol : SATA
Drive Type : SATA_HDD
  • 根据槽位点亮物理磁盘灯
./sas3ircu 0 locate 2:15 on
./sas3ircu 0 locate 2:15 off
  • 参考:​​linux查看磁盘所在槽位​​