mdadm

From Wikipedia, the free encyclopedia - View original article

mdadm
Original author(s)Neil Brown
Developer(s)Neil Brown
Initial release2001
Stable release3.3[1] / September 3, 2013; 9 months ago (2013-09-03)
Development statusActive
Written inC
Operating systemLinux
Available inEnglish
TypeDisk utility
LicenseGNU General Public License
Websitehttp://neil.brown.name/blog/mdadm
 
Jump to: navigation, search
mdadm
Original author(s)Neil Brown
Developer(s)Neil Brown
Initial release2001
Stable release3.3[1] / September 3, 2013; 9 months ago (2013-09-03)
Development statusActive
Written inC
Operating systemLinux
Available inEnglish
TypeDisk utility
LicenseGNU General Public License
Websitehttp://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.

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

Physical devices[edit]

Linux software RAID configurations can include anything presented to the Linux kernel as a block device. This includes whole hard drives (for example, /dev/sda), and their partitions (for example, /dev/sda1).

RAID configurations[edit]

Main article: Standard RAID levels

Note that RAID 10 is distinct from RAID 0+1, which consists of a top-level RAID 1 mirror composed of high-performance RAID 0 stripes directly across the physical hard disks. A single-drive failure in a RAID 10 configuration results in one of the lower-level mirrors entering degraded mode, but the top-level stripe performing normally (except for the performance hit). A single-drive failure in a RAID 0+1 configuration results in one of the lower-level stripes completely failing, and the top-level mirror entering degraded mode. Which of the two setups is preferable depends on the details of the application in question, such as whether or not spare disks are available, and how they should be spun up.

Non-RAID configurations[edit]

Types of MD devices[edit]

The original (standard) form was /dev/md<n> 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 p<m>; 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, for example.

Booting[edit]

Since support for MD is found in the kernel, there is an issue with using it before the kernel is running. 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 are usually small.

With more recent bootloaders it is possible to load the MD support as a kernel module through the initramfs mechanism, this approach allows you to let the /boot filesystem be inside any RAID system without the need of a complex manual configuration.

External metadata[edit]

Besides its own formats for RAID volumes metadata, Linux software RAID also supports external metadata formats, since version 2.6.27 of the Linux kernel and version 3.0 of the mdadm userspace utility. This allows Linux to use various firmware- or driver-based RAID volumes, also known as "fake RAID".[2]

As of October 2013, there are two supported formats of the external metadata:

Mdmpd[edit]

Mdmpd is a daemon used for monitoring MD multipath devices, developed by Red Hat as part of the mdadm package.[4] The program is used to monitor multipath (RAID) devices, and is usually started at boot time as a service, and afterwards running as a daemon.

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.

See also[edit]

References[edit]

  1. ^ Brown, Neil (2013-09-03). "ANNOUNCE: mdadm 3.3 - A tool for managing Soft RAID under Linux". 
  2. ^ a b "External Metadata". RAID Setup. kernel.org. 2013-10-05. Retrieved 2014-01-01. 
  3. ^ "DDF Fake RAID". RAID Setup. kernel.org. 2013-09-12. Retrieved 2014-01-01. 
  4. ^ "Updated mdadm package includes multi-path device enhancements". RHEA-2003:397-06. Redhat. 2004-01-16. 

External links[edit]