Copyright (C) 2000-2012 |
Manpages mdadmSection: Maintenance Commands (8)Index Return to Main Contents NAMEmdadm - manage MD devices aka Linux Software Raid.SYNOPSISmdadm [mode] <raiddevice> [options] <subdevices> DESCRIPTIONRAID devices are virtual devices created from two or more real block devices. This allows multiple devices (typically disk drives or partitions there-of) to be combined into a single device to hold (for example) a single filesystem. Some RAID levels included redundancy and so can survive some degree of device failure.Linux Software RAID devices are implemented through the md (Multiple Devices) device driver. Currently, Linux supports LINEAR md devices, RAID0 (striping), RAID1 (mirroring), RAID4 and RAID5. Recent kernels (2002) also support a mode known as MULTIPATH. mdadm does not support MULTIPATH as yet. mdadm is a program that can be used to create, manage, and monitor MD devices. As such it provides a similar set of functionality to the raidtools packages. The key differences between mdadm and raidtools are:
MODESmdadm has 7 major modes of operation:
OPTIONSAvailable options are:
For create or build:
For assemble:
General management
ASSEMBLY MODE
This usage assembles one or more raid arrays from pre-existing components. For each array, mdadm needs to know the md device, the identity of the array, and a number of sub devices. These can be found in a number of ways. The md device is either given before --scan or is found from the config file. In the latter case, multiple md devices can be started with a single mdadm command. The identity can be given with the --uuid option, with the --super-minor option, can be found in in the config file, or will be taken from the super block on the first subdevice listed on the command line. Devices can be given on the --assemble command line or from the config file. Only devices which have an md superblock which contains the right identity will be considered for any device. The config file is only used if explicitly named with --config or requested with --scan. In the later case, /etc/mdadm/mdadm.conf is used. If --scan is not given, then the config file will only be used to find the identity of md arrays. Normally the array will be started after it is assembled. However is --scan is not given and insufficient drives were lists to start a complete (non-degraded) array, then the array is not started (to guard against usage errors). To insist that the array be started in this case (as may work for RAID1 or RAID5), give the --run flag.
BUILD MODE
This usage is similar to --create. The difference is that it creates a legacy array without a superblock. With these arrays there is no difference between initially creating the array and subsequently assembling the array, except that hopefully there is useful data there in the second case. The level may only be 0, raid0, or linear. All devices must be listed and the array will be started once complete. CREATE MODE
This usage will initialise a new md array, associate some devices with it, and activate the array. As devices are added, they are checked to see if they contain raid superblocks or filesystems. They are also check to see if the variance in device size exceeds 1%. If any discrepancy is found, the array will not automatically be run, though the presence of a --run can override this caution.
The General Management options that are valid with --create are:
DETAIL MODE
This usage sill print out the details of the given array including a list of component devices. To determine names for the devices, mdadm searches /dev for device files with the right major and minor numbers. With --brief mdadm prints a single line that identifies the level, number of disks, and UUID of the array. This line is suitable for inclusion in /etc/mdadm/mdadm.conf. EXAMINE MODE
This usage will examine some block devices to see if that have a valid RAID superblock on them. The information in each valid raid superblock will be printed. If --scan is used, the no devices should be listed, and the complete set of devices identified in the configuration file are checked. --scan implies --brief but this implication can be countered by specifying --verbose. With --brief mdadm will output an config file entry of each distinct array that was found. This entry will list the UUID, the raid level, and a list of the individual devices on which a superblock for that array was found. This output will by syntactically suitable for inclusion in the configuration file, but should NOT be used blindly. Often the array description that you want in the configuration file is much less specific than that given by mdadm -Bs. For example, you normally do not want to list the devices, particularly if they are SCSI devices.
FILES/proc/mdstatIf you're using the /proc filesystem, /proc/mdstat gives you informations about md devices status. This file is not currently used by mdadm. /etc/mdadm/mdadm.confThe config file lists which devices may be scanned to see if they contain MD super block, and gives identifying information (e.g. UUID) about known MD arrays. See mdadm.conf(5) for more details.
TODOFinish and document Follow mode. SEE ALSOFor information on the various levels of RAID, check out:
for new releases of the RAID driver check out:
or mdadm.conf(5), md(4). raidtab(5), raid0run(8), raidstop(8), mkraid(8)
Index
This document was created by man2html, using the manual pages. Time: 01:58:44 GMT, March 29, 2024 |