How to find out raid in linux: cat /sys/block/sda/device/raid_level vs dmraid -s in Redhat

hard drivehardware-raidhp-prolianthp-smart-arrayraid

I am trying to find what raid level and what storage controllers are there in my remote HP server.

I can find out the following details which storage controller, size of the disk, model etc.

But how to find if the raid is active and if, which raid?

One more clarification, I need here: So, I read raid can be defined in two ways: Hardware and Software.

So, hardware I guess means the storage controller. Ours is:

             description: RAID bus controller
            product: Smart Array Gen9 Controllers

Some more info:

# hwinfo --storage
185: PCI 1f.2: 0106 SATA controller (AHCI 1.0)
  [Created at pci.319]
  Unique ID: w7Y8.AWGP+VY_LGA
  SysFS ID: /devices/pci0000:00/0000:00:1f.2
  SysFS BusID: 0000:00:1f.2
  Hardware Class: storage
  Model: "Intel SATA controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x8d02
  SubVendor: pci 0x103c "Hewlett-Packard Company"
  SubDevice: pci 0x8030
  Revision: 0x05
  Driver: "ahci"
  Driver Modules: "ahci"
  I/O Ports: 0x4058-0x405f (rw)
  I/O Ports: 0x407c-0x407f (rw)
  I/O Ports: 0x4050-0x4057 (rw)
  I/O Ports: 0x4078-0x407b (rw)
  I/O Ports: 0x4020-0x403f (rw)
  Memory Range: 0x93100000-0x931007ff (rw,non-prefetchable)
  IRQ: 211 (2357394 events)
  Module Alias: "pci:v00008086d00008D02sv0000103Csd00008030bc01sc06i01"
  Driver Info #0:
    Driver Status: ahci is active
    Driver Activation Cmd: "modprobe ahci"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

187: PCI 300.0: 0104 RAID bus controller
  [Created at pci.319]
  Unique ID: svHJ.ccZlDNM+DaD
  Parent ID: vSkL.TK0GkKDmr11
  SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:03:00.0
  SysFS BusID: 0000:03:00.0
  Hardware Class: storage
  Model: "Hewlett-Packard Company RAID bus controller"
  Vendor: pci 0x103c "Hewlett-Packard Company"
  Device: pci 0x3239
  SubVendor: pci 0x103c "Hewlett-Packard Company"
  SubDevice: pci 0x21c0
  Revision: 0x01
  Driver: "hpsa"
  Driver Modules: "hpsa"
  Memory Range: 0x92f00000-0x92ffffff (rw,non-prefetchable)
  Memory Range: 0x93000000-0x930003ff (rw,non-prefetchable)
  I/O Ports: 0x3000-0x3fff (rw)
  Memory Range: 0x93200000-0x9327ffff (ro,prefetchable,disabled)
  IRQ: 16 (no events)
  Module Alias: "pci:v0000103Cd00003239sv0000103Csd000021C0bc01sc04i00"
  Driver Info #0:
    Driver Status: hpsa is active
    Driver Activation Cmd: "modprobe hpsa"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #153 (PCI bridge)

As you can see, there are two: SATA and RAID. From lshw output, I can confirm that all the storage drives are under RAID controller. SATA controller is for Optical Drives etc.

There are two drives sda (900GB) and sdb (4.1TB).

# dmraid -r
no raid disks
# dmraid -s
no raid disks

But,

# cat /sys/block/sda/device/raid_level
RAID 1(1+0)
# cat /sys/block/sdb/device/raid_level
RAID 5

Is the raid active?

I think like this. Please correct me if I am wrong:

Hardware raid is supported, but it is not active, as raid disks are not set.
Software raid is active. So, RAID 1(1+0) in sda and RAID 5 in sdb.

If I am allowed to ask one more question:

I don't understand how software raid works and I guess its advantage is only for data recovery. As it uses only one disk, it can't do failover or have redundancy etc. right? And also, it seems unnecessary as it will only increase the data size and time.

Please correct me if I am wrong.

Best Answer

You need to use HP's RAID utilities to get this information. I;m assuming you did not build this server.

This information is readily available from the HP Smart Storage Administrator utility. It's called hpssacli. Please try running that command.

For RHEL6, the download link is here.

Once in, you can type:

ctrl all show config and ctrl all show config detail to get the RAID controller information and configuration.


[root@Worldwide-Ana ~]# hpssacli
HP Smart Storage Administrator CLI 2.30.6.0
Detecting Controllers...Done.
Type "help" for a list of supported commands.
Type "exit" to close the console.

=> ctrl all show config

Smart Array P440ar in Slot 0 (Embedded)   (sn: PDNLH0BRH9J70B)


   Port Name: 1I

   Port Name: 2I

   Internal Drive Cage at Port 1I, Box 1, OK

   Internal Drive Cage at Port 2I, Box 0, OK
   array A (SAS, Unused Space: 0  MB)


      logicaldrive 1 (1.1 TB, RAID 1+0, OK)

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 600 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 600 GB, OK)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 600 GB, OK)
      physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 600 GB, OK)