HOME

TheInfoList



OR:

mdadm is a
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
utility used to manage and monitor
software RAID Raid, RAID or Raids may refer to: Attack * Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground * Corporate raid, a type of hostile takeover in business * Panty raid, a prankish raid by male college ...
devices. It is used in modern
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s in place of older software RAID utilities such as raidtools2 or raidtools. mdadm is
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
originally maintained by, and copyrighted to, Neil Brown of
SUSE SUSE ( , ) is a German-based multinational open-source software company that develops and sells Linux products to business customers. Founded in 1992, it was the first company to market Linux for enterprise. It is the developer of SUSE Linux Ent ...
, and licensed under the terms of version 2 or later of the
GNU General Public License The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the Four Freedoms (Free software), four freedoms to run, study, share, and modify the software. The license was th ...
.


Name

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 more functions were added. The name is now understood to be short for Multiple Disk and Device Management.


Overview

Linux software RAID configurations can include anything presented to the
Linux kernel The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
as a
block device In Unix-like operating systems, a device file or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow an ...
. This includes whole hard drives (for example, ), and their
partitions Partition may refer to: Computing Hardware * Disk partitioning, the division of a hard disk drive * Memory partition, a subdivision of a computer's memory, usually for use by a single job Software * Partition (database), the division of a ...
(for example, ).


RAID configurations

* ''RAID 0'' – Block-level
striping In computer data storage, data striping is the technique of segmenting logically sequential data, such as a file, so that consecutive segments are stored on different physical storage devices. Striping is useful when a processing device request ...
. MD can handle devices of different lengths, the extra space on the larger device is then not striped. * ''RAID 1'' – Mirror. * ''RAID 4'' – Like RAID 0, but with an extra device for the parity. * ''RAID 5'' – Like RAID 4, but with the parity distributed across all devices. * ''RAID 6'' – Like RAID 5, but with two parity segments per stripe. * ''RAID 10'' – Take a number of RAID 1 mirrorsets and stripe across them RAID 0 style. ''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 When a RAID array experiences the failure of one or more disks, it can enter degraded mode, a fallback mode that generally allows the continued usage of the array, but either loses the performance boosts of the RAID technique (such as a RAID-1 mir ...
, 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

* ''Linear'' – concatenates a number of devices into a single large MD device. * ''Multipath'' – provides multiple paths with failover to a single device. * ''Faulty'' – a single device which emulates a number of disk-fault scenarios for testing and development. * ''Container'' – a group of devices managed as a single device, in which one can build RAID systems.


Features

The original (standard) form of names for md devices is , where is a number between 0 and 99. More recent kernels have support for names such as . Under 2.4.x kernels and earlier these two were the only options. Both of them are non-partitionable. Since 2.6.x kernels, a new type of MD device was introduced, a partitionable array. The device names were modified by changing to . The partitions were identified by adding , where is the partition number; thus for example. Since version 2.6.28 of the
Linux kernel mainline The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU oper ...
, non-partitionable arrays can be partitioned, the partitions being referred to in the same way as for partitionable arrays for example, . Since version 3.7 of the Linux kernel mainline, md supports
TRIM Trim or TRIM may refer to: Cutting * Cutting or trimming small pieces off something to remove them ** Book trimming, a stage of the publishing process ** Pruning, trimming as a form of pruning often used on trees Decoration * Trim (sewing), or ...
operations for the underlying
solid-state drive A solid-state drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data persistently, typically using flash memory, and functioning as secondary storage in the hierarchy of computer storage. It is ...
s (SSDs), for linear, RAID 0, RAID 1, RAID 5 and RAID 10 layouts.


Booting

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 Grub can refer to Grub (larva), of the beetle superfamily Scarabaeoidea, or as a slang term for food. It can also refer to: Places * Grub, Appenzell Ausserrhoden, Switzerland * Grub, St. Gallen, Switzerland * Grub (Amerang), a hamlet in Bavaria, ...
legacy. Although normally present, it ''may'' not be present for GRUB 2. In order to circumvent this problem a 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 filesystems are usually small. With more recent bootloaders it is possible to load the MD support as a kernel module through the
initramfs In Linux systems, initrd (''initial ramdisk'') is a scheme for loading a temporary root file system into memory, to be used as part of the Linux startup process. initrd and initramfs refer to two different methods of achieving this. Both are comm ...
mechanism. This approach allows the filesystem to be inside any RAID system without the need of a complex manual configuration.


External metadata

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 userspace utility. This allows Linux to use various firmware- or driver-based RAID volumes, also known as "
fake RAID Raid, RAID or Raids may refer to: Attack * Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground * Corporate raid, a type of hostile takeover in business * Panty raid, a prankish raid by male college ...
". , there are two supported formats of the external metadata: * DDF (
Disk Data Format The SNIA Common RAID Disk Data Format (DDF) defines a standard data structure describing how data is formatted across disks in a RAID group. The DDF structure allows a basic level of interoperability between different suppliers of RAID technology. ...
), an industry standard defined by the
Storage Networking Industry Association The Storage Networking Industry Association (SNIA) is a registered 501(c)(6) non-profit trade association incorporated in December 1997. SNIA has more than 185 unique members, 2,000 active contributing members and over 50,000 IT end users and sto ...
for increased interoperability. * Volume metadata format used by the
Intel Rapid Storage Technology Intel Rapid Storage Technology (RST) is a driver SATA AHCI and a firmware-based RAID solution built into a wide range of Intel chipsets. Currently also is installed as a driver for Intel Optane temporary storage units. It contains two oper ...
(RST), former Intel Matrix RAID, implemented on many consumer-level motherboards.


mdmpd

mdmpd was a
daemon Daimon or Daemon (Ancient Greek: , "god", "godlike", "power", "fate") originally referred to a lesser deity or guiding spirit such as the daimons of ancient Greek religion and mythology and of later Hellenistic religion and philosophy. The word ...
used for monitoring MD multipath devices up to
Linux kernel The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
2.6.10-rc1, developed by
Red Hat Red Hat, Inc. is an American software company that provides open source software products to enterprises. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North Carolina, with other offices worldwide. Red Hat has become ass ...
as part of the mdadm package. The program was used to monitor multipath (
RAID Raid, RAID or Raids may refer to: Attack * Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground * Corporate raid, a type of hostile takeover in business * Panty raid, a prankish raid by male college ...
) 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, 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 filesystem, lists all active md devices with information about them. Mdmpd requires this to find arrays to monitor paths on, to get notification of interesting events and to monitor array reconstruction on Monitor mode.


Technical details Raid 1

The data on a raid 1 Volume will be the same like the data in a normal Partition. The RAID Information will stored in the last 128kB of the Partition. This means, to convert a RAID 1 Volume to normal data Partition it is possible to decrease the Partition size about 128kB and change the Partition ID from fd to 83 (for linux).


See also

*
Software RAID Raid, RAID or Raids may refer to: Attack * Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground * Corporate raid, a type of hostile takeover in business * Panty raid, a prankish raid by male college ...
*
bioctl The bio(4) pseudo-device driver and the bioctl(8) utility implement a generic RAID volume management interface in OpenBSD and NetBSD. The idea behind this software is similar to ifconfig, where a single utility from the operating system can be ...
on OpenBSD/NetBSD


References


External links


mdadm source code releases
* * {{cite web , url = http://www.technotes.se/?p=1732 , title = Setting up a RAID volume in Linux with >2TB disks , author = Lonezor , date = 2011-11-13 , url-status = dead , archiveurl = https://web.archive.org/web/20111119090413/http://www.technotes.se/?p=1732 , archivedate = 2011-11-19 Free software programmed in C Free system software Linux file system-related software RAID