大网数据广告活动
服务器运维问答

Can I detect hardware RAID information from inside Linux?

· 52CE 我爱测

When I'm inside of Linux, I can get the following information from lsblk (irrelevant drives removed from output): NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 298G 0 disk sdb 8:16 0 2.7T 0 disk When I manually pull the drive…

问题原文

原帖链接 · IQAndreas · CC BY-SA 4.0

When I'm inside of Linux, I can get the following information from lsblk (irrelevant drives removed from output):

NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda     8:0    0   298G  0 disk 
sdb     8:16   0   2.7T  0 disk

When I manually pull the drives out of the server, I can tell I'm physically using the following drives:

0  Seagate 320GB
1  Seagate 320GB
2  Hitachi 1TB
3  Hitachi 1TB
4  Hitachi 1TB
5  Hitachi 1TB
6  [empty]
7  [empty]

Because there is more physical storage in the server than available space in Linux, this means I'm obviously using some form of RAID system. With a bit of math, I can often figure out what type of RAID system is being used.

Is there a way for me to detect if I'm using hardware RAID from inside of Linux, and figure out all the information about it (such as type of RAID, available drives) without turning off the server, physically pulling the drives out, and reading their labels?

Can this information be gathered from inside of Linux, or is the point of hardware RAID to make the underlying system "invisible" to the operating system?

已采纳解答

原帖链接 · IQAndreas · CC BY-SA 3.0

How to get the RAID information is going to depend entirely on the RAID controller you are using. Often, manufacturers will have tools that can be downloaded from their website which can be used to query the RAID controller and get this information.

In order to find which RAID controller you are using, try one of the following commands:

lspci

# lspci -knn | grep 'RAID bus controller'
08:00.0 RAID bus controller [0104]: 3ware Inc 9690SA SAS/SATA-II RAID PCIe [13c1:1005] (rev 01)

Here, the information we are looking for is "3ware Inc 9690SA SAS/SATA-II RAID PCIe".

lsscsi

The command is not available on Debian and Ubuntu, but a quick sudo apt-get install lsscsi will fetch it from the repos. Note, if you are not using a RAID controller, the manufacturer and model number of your harddrive will show up here instead.

# lsscsi
[2:0:0:0]    disk    AMCC     9690SA-8I  DISK  4.08  /dev/sda 
[2:0:1:0]    disk    AMCC     9690SA-8I  DISK  4.08  /dev/sdb 

Here we see the manufacturer is "AMCC" and the model number of the RAID card is "9690SA-8I". A quick Google search shows that this card is also known as "AMCC 3Ware 9690SA-8I".

lshw

A third method (which gives quite a bit of output data) is to use the lshw command. Run lshw -class disk as root to only display the details about harddrives (which includes RAID information).

Finding the RAID controller tools

Now that we have the manufacturer and model number, it should be possible to find the tools on their website, or at least be able to Google details on how to find and use the tools for that specific controller.

If the manufacturer shows up in this list, see these answers for more details on how to get the RAID information for your card:

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-09-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。