3

Is it possible to know by Linux command if my RAID is HW or SW RAID?

for example in my machine - BLADE from dell MANUFACTURE

by /ptoc/mdstat seems my RAID is "SW RAID" ?

cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdr2[1] sdq2[0]
  390054912 blocks super 1.2 [2/2] [UU]
  bitmap: 1/3 pages [4KB], 65536KB chunk

md0 : active raid1 sdr1[1] sdq1[0]
  524224 blocks super 1.0 [2/2] [UU]
  bitmap: 0/1 pages [0KB], 65536KB chunk

but how to absolutely know if my RAID is SW or HW ? BY WHICH COMMAND LINE?

from lsblk

lsblk

vg00-lv_root 253:0    0    50G  0 lvm   /
└─md1          9:1    0   372G  0 raid1
├─sdq2      65:2    0 372.1G  0 part
│ └─sdq     65:0    0 372.6G  0 disk
└─sdr2      65:18   0 372.1G  0 part
  └─sdr     65:16   0 372.6G  0 disk
vg00-lv_swap 253:1    0    16G  0 lvm   [SWAP]
└─md1          9:1    0   372G  0 raid1
├─sdq2      65:2    0 372.1G  0 part
│ └─sdq     65:0    0 372.6G  0 disk
└─sdr2      65:18   0 372.1G  0 part
  └─sdr     65:16   0 372.6G  0 disk
vg00-lv_var  253:2    0   100G  0 lvm   /var
 └─md1          9:1    0   372G  0 raid1
 ├─sdq2      65:2    0 372.1G  0 part
 │ └─sdq     65:0    0 372.6G  0 disk
 └─sdr2      65:18   0 372.1G  0 part
    └─sdr     65:16   0 372.6G  0 disk



  mdadm --detail /dev/md1
  /dev/md1:
       Version : 1.2
  Creation Time : Mon Jun 26 13:14:03 2017
    Raid Level : raid1
    Array Size : 390054912 (371.99 GiB 399.42 GB)
    Used Dev Size : 390054912 (371.99 GiB 399.42 GB)
    Raid Devices : 2
    Total Devices : 2
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

   Update Time : Sun Jul  9 12:45:29 2017
         State : clean
  Active Devices : 2
  Working Devices : 2
  Failed Devices : 0
  Spare Devices : 0

         Name : localhost:1
         UUID : b13eee32:f5894d0c:23aaf608:a67290c9
         Events : 605

    Number   Major   Minor   RaidDevice State
      0      65        2        0      active sync   /dev/sdq2
      1      65       18        1      active sync   /dev/sdr2
shalom
  • 461
  • 13
  • 29

1 Answers1

3

The mdX devices shown in the output of /proc/mdstat are software raid devices created mdadm. You can have software raid configured on your machine.

From the output, it is clear you have raid1 configured. To get more information, you can use mdadm --detail /dev/mdX.

Having software raid configured on your machine does not mean you don't have a hardware raid configured also (which may or may not make sense!).

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • so for summary can we use this syntax in order to verify SW or HW RAID - [[ ` cat /proc/mdstat | grep -c md ` -eq 2 ]] && echo "SW RAID" || echo "HW RAID" – shalom Jul 09 '17 at 12:41
  • from mdadm --detail /dev/md1 output ( as I already edit in my question ) , what is the values from the command that show this is SW configuration ? – shalom Jul 09 '17 at 12:49
  • @shalom: No specific value is required. It is just having such devices `mdX` under `/proc/mdstat`. – Khaled Jul 09 '17 at 13:13
  • 1
    At the risk of nitpicking, /proc/mdstat can only tell if you are or are not using SW RAID. You can make no inferences about HW RAID at all from /proc/mdstat. If you REALLY want to be sure about HW RAID, and have a known set of possible hw possibilities, you could write a script to check for the existence configuration/status utilities and execute them if found. Or possibly query a management processor (BMC/ILO/DRAC/IPMI/etc). Or possibly SNMP. – Brandon Xavier Jul 10 '17 at 04:21