Sunday, July 17, 2011

Manage Intel RAID under GNU/Linux using mdadm tool

You may be interesting to read some history about RAID first.
This article is about managing Intel RAID, with mdadm tool, but some information may apply to others kinds.
To begin, you can find lots of information about RAID under GNU/Linux.

IMPORTANT: for Intel's IMSM support you need at least
version 3.2 of mdadm tool (thanks to Iwan for this information).

Usually, there is a container device (let's call it /dev/md127 in this article), and the RAID device (let's call it /dev/md126 in this article).
Instead of long blabla, this article will give some common commands to help manage Intel RAID with mdadm tool.

To report the RAID information from the Option ROM (for instance "Intel(R) Matrix Storage Manager"):
mdadm --detail-platform

To get general details:
mdadm -D /dev/md127

To examine information (including members):
mdadm -E /dev/md127

To assemble the RAID array inside the container, and/or to start it (the -e option declares the style of RAID metadata (superblock) to be used):
mdadm -I -e imsm /dev/md127

To check the current state:
cat /proc/mdstat

Output sample (with a RAID 10 having 4 members):
Personalities : [raid10]
md126 : active raid10 sda[3] sdb[2] sdc[1] sdd[0]
      3907023872 blocks super external:/md127/0 64K chunks 2 near-copies [4/4] [UUUU]
      [=>...................]  resync =  6.6% (258923904/3907024128) finish=305.7min speed=198882K/sec
md127 : inactive sdb[3](S) sda[2](S) sdc[1](S) sdd[0](S)
      9028 blocks super external:imsm

To add it to the configuration file (to be activated automagically at boot):
mdadm --examine --scan >> /etc/mdadm.conf

For advanced commands (including repairing), you should read this.

RAID 10 on Intel ICH10R under GNU/Linux (including HDD devices on Marvell 88SE9128)

After my experience to setup a RAID 0 on Intel ICH10R Vs Marvell 88SE9128; I've recently experienced the setup of
a RAID 10 on Intel ICH10R, using the mdadm tool.

To begin, I've never succeeded to install a bootable Operating System directly on the RAID (tested with Fedora 12, Fedora 13, Fedora 14, Ubuntu 10.04 LTS and Mandriva 2010.1).
So I added an additional HDD device dedicated to the OS, that I plugged on the Marvell 88SE9128 (at the moment, it was more easy with cables).
This time, the OS was bootable, but asap there was more or less I/O stress on drives (OS or RAID ones), the system failed with lots of severe I/O errors, and eventually one of the RAID HDD was declared offline (although it was healthy).

As soon as I plugged all the HDD devices on the Intel ICH10R controller (and after a last OS installation ...), everything became perfect : very efficient and very stable with absolutely no I/O error whatever the stress.
For information, there is no problem with optical devices on the Marvell 88SE9128 controller.

Like in my last article on this subject, I can only conclude that if ever there is a RAID configuration on a system, no HDD devices should be plugged to the Marvell 88SE9128 controller; otherwise the system will be strongly instable and will eventually fail.

Some history about Intel RAID under GNU/Linux (dmraid/mdadm)

Although RAID is supported under GNU/Linux since many years, it is not trivial either.
This article is about Intel RAID, but some information may apply to others kinds.

There is at least two tools allowing to manage RAID devices:

 - dmraid (Device-mapper RAID tool and library)
 - mdadm (controls Linux md devices - software RAID arrays)

Intel RAID can be regarded as pseudo-Hardware-based RAID or Software-based RAID, so the 2 tools can be used.
Anyway, mdadm is more commonly used with modern distribution (for instance Fedora switched from dmraid to mdraid since version 12).

Besides, if you ever have a problem after an OS upgrade, with an existing RAID that you manage with dmraid, you should use the kernel option "noiswmd" which will make the system use dmraid for Intel BIOS RAID instead of mdraid.