mdadm

mdadm
Original author(s) Neil Brown
Developer(s) Neil Brown
Initial release 2001
Stable release 3.2.1[1] / April 28, 2011; 9 months ago (2011-04-28)
Development status Active
Written in C
Operating system Linux
Available in English
Type Disk utility
License GNU General Public License
Website http://neil.brown.name/blog/mdadm

mdadm is a Linux utility used to manage software RAID devices.

The name is derived from the md (multiple device) device nodes it administers or manages, and it replaced a previous utility mdctl. The original name was "Mirror Disk", but was changed as the functionality increased.

It is free software licensed under version 2 or later of the GNU General Public License - maintained and copyrighted to Neil Brown of Suse.

Contents

Functionality

Types of physical device

mdadm can handle anything which presents to the kernel as a block device. This can encompass whole disks (/dev/sda), partitions (/dev/sda1) and USB flash drives.

RAID Configurations

Non-RAID Configurations

Types of MD device

The original (standard) form was /dev/mdn where n is a number between 0 and 99. More recent kernels have supported the use of names such as /dev/md/Home. Under kernel 2.4 and earlier these two were the only options. Both of them are non-partitionable.

From kernel 2.6 a new type of MD device was introduced, a partitionable array. The device names were modified by changing md to md_d. The partitions were identified by adding pn; thus /dev/md/md_d2p3 for example.

From kernel 2.6.28 non-partitionable arrays can be partitioned, the partitions being referred to in the same way as for partitionable arrays: /dev/md/md1p2.

Booting

Since support for MD is found in the kernel, it may not be supported by all boot loaders.. Specifically it will not be present if the boot loader is either (e)LiLo or GRUB legacy. It may not be present for GRUB 2. In order to circumvent this problem a /boot filesystem must be used either without md support, or else with RAID1. In the latter case the system will boot by treating the RAID1 device as a normal filesystem, and once the system is running it can be remounted as md and the second disk added to it. This will result in a catch-up, but /boot filesystems ought to be small.

Growing an array by adding devices

An array may be "grown" (increased in size) by adding devices.

Growing an array by upgrading devices

An array may be upgraded by replacing the devices one by one, either as a planned upgrade or ad hoc as a result of replacing failed devices.

A partition may be given as missing to act as a placeholder so that it can be added later.

Mdmpd

Mdmpd is a computer program for the GNU/Linux Operating System. It is part of the mdadm package written and copyrighted by Red Hat. The program is used to monitor multi-path (RAID) devices, and is usually started at boot time as a service, and afterwards running as a daemon.

mdmpd - daemon to monitor MD multipath devices

Enterprise storage requirements often include the desire to have more than one way to talk to a single disk drive so that in the event of some failure to talk to a disk drive via one controller, the system can automatically switch to another controller and keep going. This is called multipath disk access. The linux kernel implements multipath disk access via the software RAID stack known as the md (Multiple Devices) driver. The kernel portion of the md multipath driver only handles routing I/O requests to the proper device and handling failures on the active path. It does not try to find out if a path that has previously failed might be working again. That's what this daemon does. Upon startup, the daemon will fork and place itself in the background. Then it reads the current state of the md raid arrays, saves that state, and then waits for the kernel to tell it something interesting has happened. It then wakes up, checks to see if any paths on a multipath device have failed, and if they have then it starts to poll the failed path once every 15 seconds until it starts working again. Once it starts working again, the daemon will then add the path back into the multipath md device it was originally part of as a new spare path.

If one is using the /proc filesystem, /proc/mdstat lists all active md devices with information about them. Mdmpd requires this to find arrays to monitor paths on and to get notification of interesting events.

References

External links