The first thing you must learn about RAID technologies in Linux is that they have nothing in common with HP-UX, and I mean nothing! Yes there is LVM but that’s all, the mirror of a volume group for example is not done through LVM commands, in fact you are not going to mirror a volume group but the block device/s where the volume group resides.
There are two tools to manage RAID in Linux.
dmraid is used to discover and activate software (ATA)RAID arrays, commonly known as fakeRAID, and
mdadm is used to manage Linux Software RAID devices.
libdevmapper and the device-mapper kernel driver to perform all the tasks.
The device-mapper is a component of the Linux Kernel. This the way the Linux Kernel do all the block device management. It maps a block device onto another and forms the base of volume management (LVM2 and EVMS) and software raid. Multipathing support is also provided through the device-mapper. Device-mapper support is present in 2.6 kernels although there are patches for the most recent versions of 2.4 kernel version.
dmraid supports several array types.
Following are a couple of examples to show
Activate all discovered arrays
Deactivate all discovered arrays
mdadm, is a tool to manage the Linux software RAID arrays. This tool has nothing to do with the device-mapper, in fact the device-mapper is not aware of the RAID arrays created with
To illustrate this take a look at the screenshot below. I created a RAID1 device,
/dev/md0, I then show its configuration with
mdadm --detail. Later with dmsetup ls I list all the block devices seen by the device-mapper, as you can see there is no reference to
mdadm uses the MD (Multiple Devices) device driver, this driver provides virtual devices created from another independent devices. Currently the MD driver supports the following RAID levels and configurations
- LINEAR (a concatenated array)
- FAULTY (an special failed array type for testing purposes)
The configuration of the MD devices is contained in the
mdadm tool has seven operation modes.
- Follow or Monitor
A more detailed description of every major operation mode is provided in
mdadm man page.
Finally below are examples of some of the more common operations with
Create a RAID1 array
Get detailed configuration of the array
Destroy the array
Create a RAID5 array with an spare device
Check for the status of a task into the /proc/mdstat file.
Generate the mdadm.conf file from the current active devices.
As a final thought, my recommendation is that if there is hardware RAID controller available, like the HP Smart Array P400 for example, go hard-RAID five by five and if not always use
mdadm even if there is an onboard RAID controller.