X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mdadm.8;h=432241958a4fb219b0f4b3c0623da891d1034fc0;hb=4408ee768bab1282b23d97c3d3e073292f79e982;hp=6edc9154297d683bb40548764d8b81435b03e1ff;hpb=6a0671608bd94e75683fd5ca7ea006b9c7552de3;p=thirdparty%2Fmdadm.git diff --git a/mdadm.8 b/mdadm.8 index 6edc9154..43224195 100644 --- a/mdadm.8 +++ b/mdadm.8 @@ -1,11 +1,11 @@ .\" -*- nroff -*- -''' Copyright Neil Brown and others. -''' This program is free software; you can redistribute it and/or modify -''' it under the terms of the GNU General Public License as published by -''' the Free Software Foundation; either version 2 of the License, or -''' (at your option) any later version. -''' See file COPYING in distribution for details. -.TH MDADM 8 "" v2.6.4 +.\" Copyright Neil Brown and others. +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2 of the License, or +.\" (at your option) any later version. +.\" See file COPYING in distribution for details. +.TH MDADM 8 "" v3.0-devel2 .SH NAME mdadm \- manage MD devices .I aka @@ -38,8 +38,9 @@ md devices, .BR RAID6 , .BR RAID10 , .BR MULTIPATH , +.BR FAULTY , and -.BR FAULTY . +.BR CONTAINER . .B MULTIPATH is not a Software RAID mechanism, but does involve @@ -50,41 +51,64 @@ each device is a path to one common physical storage device. is also not true RAID, and it only involves one device. It provides a layer over a true device that can be used to inject faults. -'''.B 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 -'''.B raidtools -'''packages. -'''The key differences between -'''.B mdadm -'''and -'''.B raidtools -'''are: -'''.IP \(bu 4 -'''.B mdadm -'''is a single program and not a collection of programs. -'''.IP \(bu 4 -'''.B mdadm -'''can perform (almost) all of its functions without having a -'''configuration file and does not use one by default. Also -'''.B mdadm -'''helps with management of the configuration -'''file. -'''.IP \(bu 4 -'''.B mdadm -'''can provide information about your arrays (through Query, Detail, and Examine) -'''that -'''.B raidtools -'''cannot. -'''.P -'''.I mdadm -'''does not use -'''.IR /etc/raidtab , -'''the -'''.B raidtools -'''configuration file, at all. It has a different configuration file -'''with a different format and a different purpose. +B CONTAINER +is different again. A +.B CONTAINER +is a collection of devices that are +managed as a set. This is similar to the set of devices connected to +a hardware RAID controller. The set of devices may contain a number +of different RAID arrays each utilising some (or all) blocks from a +number of the devices in the set. For example, two devices in a 5-device set +might form a RAID1 used the whole devices. The remaining three might +have a RAID5 over the first half of each device, and a RAID0 over the +second half. + +With a +.BR CONTAINER , +there is one set of metadata that describes all of +the arrays in the container. So when +.I mdadm +creates a +.B CONTAINER +device, it just represents the metadata. Other normal arrays (RAID1 +etc) can be created inside that container. + + +.\".I 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 +.\".B raidtools +.\"packages. +.\"The key differences between +.\".I mdadm +.\"and +.\".B raidtools +.\"are: +.\".IP \(bu 4 +.\".I mdadm +.\"is a single program and not a collection of programs. +.\".IP \(bu 4 +.\".I mdadm +.\"can perform (almost) all of its functions without having a +.\"configuration file and does not use one by default. Also +.\".I mdadm +.\"helps with management of the configuration +.\"file. +.\".IP \(bu 4 +.\".I mdadm +.\"can provide information about your arrays (through Query, Detail, and Examine) +.\"that +.\".B raidtools +.\"cannot. +.\".P +.\".I mdadm +.\"does not use +.\".IR /etc/raidtab , +.\"the +.\".B raidtools +.\"configuration file, at all. It has a different configuration file +.\"with a different format and a different purpose. .SH MODES mdadm has several major modes of operation: @@ -93,7 +117,7 @@ mdadm has several major modes of operation: Assemble the components of a previously created array into an active array. Components can be explicitly given or can be searched for. -.B mdadm +.I mdadm checks that the components do form a bona fide array, and can, on request, fiddle superblock information so as to assemble a faulty array. @@ -113,8 +137,8 @@ what you are doing. .TP .B Create Create a new array with per-device superblocks. -'''It can progress -'''in several step create-add-add-run or it can all happen with one command. +.\"It can progress +.\"in several step create-add-add-run or it can all happen with one command. .TP .B "Follow or Monitor" @@ -139,6 +163,13 @@ This provides a convenient interface to a system. As each device is detected, .I mdadm has a chance to include it in some array as appropriate. +.P +If a +.B CONTAINER +is passed to +.I mdadm +in this mode, then any arrays within that container will be assembled +and started. .TP .B Manage @@ -150,8 +181,8 @@ adding new spares and removing faulty devices. This is an 'everything else' mode that supports operations on active arrays, operations on component devices such as erasing old superblocks, and information gathering operations. -'''This mode allows operations on independent devices such as examine MD -'''superblocks, erasing old superblocks and stopping active arrays. +.\"This mode allows operations on independent devices such as examine MD +.\"superblocks, erasing old superblocks and stopping active arrays. .TP .B Auto-detect @@ -241,7 +272,7 @@ and .TP .BR \-q ", " \-\-quiet Avoid printing purely informative messages. With this, -.B mdadm +.I mdadm will be silent unless there is something really important to report. .TP @@ -272,10 +303,12 @@ If the config file given is then nothing will be read, but .I mdadm will act as though the config file contained exactly -.B "DEVICE partitions" +.B "DEVICE partitions containers" and will read .B /proc/partitions -to find a list of devices to scan. +to find a list of devices to scan, and +.B /proc/mdstat +to find a list of containers to examine. If the word .B "none" is given for the config file, then @@ -288,7 +321,7 @@ Scan config file or .B /proc/mdstat for missing information. In general, this option gives -.B mdadm +.I mdadm permission to get any missing information (like component devices, array devices, array identities, and alert destination) from the configuration file (see previous option); @@ -325,6 +358,15 @@ Use the new version-1 format superblock. This has few restrictions. The different sub-versions store the superblock at different locations on the device, either at the end (for 1.0), at the start (for 1.1) or 4K from the start (for 1.2). +.IP ddf +Use the "Industry Standard" DDF (Disk Data Format) format. When +creating a DDF array a +.B CONTAINER +will be created, and normal arrays can be created in that container. +.IP imsm +Use the Intel Matrix Storage Manager metadata format. This creates a +.B CONTAINER +which is managed in a similar manner to DDF. .RE .TP @@ -397,6 +439,10 @@ The size can be given as .B max which means to choose the largest size that fits on all current drives. +This value can not be used with +.B CONTAINER +metadata such as DDF and IMSM. + .TP .BR \-c ", " \-\-chunk= Specify chunk size of kibibytes. The default is 64. @@ -410,7 +456,14 @@ Specify rounding factor for linear array (==chunk size) Set raid level. When used with .BR \-\-create , options are: linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4, -raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty. Obviously some of these are synonymous. +raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty, container. +Obviously some of these are synonymous. + +When a +.B CONTAINER +metadata type is requested, only the +.B container +level is permitted, and it does not need to be explicitly given. When used with .BR \-\-build , @@ -633,9 +686,9 @@ partitions. A different number of partitions can be specified at the end of this option (e.g. .BR \-\-auto=p7 ). If the device name ends with a digit, the partition names add a 'p', -and a number, e.g. "/dev/home1p3". If there is no +and a number, e.g. "/dev/md/home1p3". If there is no trailing digit, then the partition names just have a number added, -e.g. "/dev/scratch3". +e.g. "/dev/md/scratch3". If the md device name is in a 'standard' format as described in DEVICE NAMES, then it will be created, if necessary, with the appropriate @@ -643,29 +696,30 @@ number based on that name. If the device name is not in one of these formats, then a unused minor number will be allocated. The minor number will be considered unused if there is no active array for that number, and there is no entry in /dev for that number and with a -non-standard name. - -.TP -.BR \-\-symlink = no -Normally when -.B \-\-auto -causes -.I mdadm -to create devices in -.B /dev/md/ -it will also create symlinks from -.B /dev/ -with names starting with -.B md -or -.BR md_ . -Use -.B \-\-symlink=no -to suppress this, or -.B \-\-symlink=yes -to enforce this even if it is suppressing -.IR mdadm.conf . - +non-standard name. Name that are not in 'standard' format are only +allowed in "/dev/md/". + +\".TP +\".BR \-\-symlink = no +\"Normally when +\".B \-\-auto +\"causes +\".I mdadm +\"to create devices in +\".B /dev/md/ +\"it will also create symlinks from +\".B /dev/ +\"with names starting with +\".B md +\"or +\".BR md_ . +\"Use +\".B \-\-symlink=no +\"to suppress this, or +\".B \-\-symlink=yes +\"to enforce this even if it is suppressing +\".IR mdadm.conf . +\" .SH For assemble: @@ -688,7 +742,7 @@ will cause to use the minor number of the md device that is being assembled. e.g. when assembling .BR /dev/md0 , -.M \-\-super\-minor=dev +.B \-\-super\-minor=dev will look for super blocks with a minor number of 0. .TP @@ -905,6 +959,17 @@ the system to be marked as failed. It can then be removed. same as .BR \-\-fail . +.TP +.BR \-\-write\-mostly +Subsequent devices that are added or re-added will have the 'write-mostly' +flag set. This is only valid for RAID! and means that the 'md' driver +will avoid reading from these devices if possible. +.TP +.BR \-\-readwrite +Subsequent devices that are added or re-added will have the 'write-mostly' +flag cleared. + + .P Each of these options require that the first device listed is the array to be acted upon, and the remainder are component devices to be added, @@ -946,7 +1011,9 @@ Print detail of one or more md devices. .TP .BR \-Y ", " \-\-export When used with -.BR \-\-detail , +.B \-\-detail +or +.BR \-\-examine , output will be formatted as .B key=value pairs for easy import into the environment. @@ -1012,6 +1079,19 @@ activity to finish before returning. will return with success if it actually waited for every device listed, otherwise it will return failure. +.TP +.BR \-\-wait\-clean +For each md device given, arrange for the array to be marked clean as +soon as possible. Also, quiesce resync so that the monitor for external +metadata arrays (mdmon) has an opportunity to checkpoint the resync +position. +.I mdadm +will return with success if the array uses external metadata and we +successfully waited. For native arrays this returns immediately as the +kernel handles both dirty-clean transitions and resync checkpointing in +the kernel at shutdown. No action is taken if safe-mode handling is +disabled. + .SH For Incremental Assembly mode: .TP .BR \-\-rebuild\-map ", " \-r @@ -1055,14 +1135,14 @@ facility of 'daemon' and varying priorities. .TP .BR \-d ", " \-\-delay Give a delay in seconds. -.B mdadm +.I mdadm polls the md arrays and then waits this many seconds before polling again. The default is 60 seconds. .TP .BR \-f ", " \-\-daemonise Tell -.B mdadm +.I mdadm to run as a background daemon if it decides to monitor anything. This causes it to fork and run in the child, and to disconnect form the terminal. The process id of the child is written to stdout. @@ -1074,7 +1154,7 @@ is found in the config file. .TP .BR \-i ", " \-\-pid\-file When -.B mdadm +.I mdadm is running in daemon mode, write the pid of the daemon process to the specified file, instead of printing it on standard output. @@ -1126,7 +1206,8 @@ the first device given is the md device. In the second usage example, all devices listed are treated as md devices and assembly is attempted. In the third (where no devices are listed) all md devices that are -listed in the configuration file are assembled. +listed in the configuration file are assembled. Then any arrays that +can be found on unused devices will also be assembled. If precisely one device is listed, but .B \-\-scan @@ -1156,6 +1237,8 @@ or requested with (a possibly implicit) .BR \-\-scan . In the later case, .B /etc/mdadm.conf +or +.B /etc/mdadm/mdadm.conf is used. If @@ -1220,16 +1303,13 @@ and no devices are listed, will first attempt to assemble all the arrays listed in the config file. -If a -.B homehost -has been specified (either in the config file or on the command line), -.I mdadm -will look further for possible arrays and will try to assemble -anything that it finds which is tagged as belonging to the given -homehost. This is the only situation where -.I mdadm -will assemble arrays without being given specific device name or -identity information for the array. +It will then look further for possible arrays and will try to assemble +anything that it finds. Arrays which are tagged as belonging to the given +homehost will be assembled and started normally. Arrays which do not +obviously belong to this host are given names that are expected not to +conflict with anything local, and are started "read-auto" so that +nothing is written to any device until the array is written to. i.e. +automatic resync etc is delayed. If .I mdadm @@ -1323,7 +1403,7 @@ can override this caution. To create a "degraded" array in which some devices are missing, simply give the word "\fBmissing\fP" in place of a device name. This will cause -.B mdadm +.I mdadm to leave the corresponding slot in the array empty. For a RAID4 or RAID5 array at most one slot can be "\fBmissing\fP"; for a RAID6 array at most two slots. @@ -1332,7 +1412,7 @@ others can be "\fBmissing\fP". When creating a RAID5 array, -.B mdadm +.I mdadm will automatically create a degraded array with an extra spare drive. This is because building the spare into a degraded array is in general faster than resyncing the parity on a non-degraded, but not clean, array. This feature can @@ -1340,13 +1420,13 @@ be overridden with the .B \-\-force option. -When creating an array with version-1 metadata a name for the host is +When creating an array with version-1 metadata a name for the array is required. If this is not given with the .B \-\-name option, .I mdadm -will chose a name based on the last component of the name of the +will choose a name based on the last component of the name of the device being created. So if .B /dev/md3 is being created, then the name @@ -1358,6 +1438,14 @@ is being created, then the name .B home will be used. +When creating a partition based array, using +.I mdadm +with version-1.x metadata, the partition type should be set to +.B 0xDA +(non fs-data). This type selection allows for greater precision since +using any other [RAID auto-detect (0xFD) or a GNU/Linux partition (0x83)], +might create problems in the event of array recovery through a live cdrom. + A new array will normally get a randomly assigned 128bit UUID which is very likely to be unique. If you have a specific need, you can choose a UUID for the array by giving the @@ -1368,14 +1456,24 @@ recipe for disaster. Also, using when creating a v0.90 array will silently override any .B \-\-homehost= setting. -'''If the -'''.B \-\-size -'''option is given, it is not necessary to list any component-devices in this command. -'''They can be added later, before a -'''.B \-\-run. -'''If no -'''.B \-\-size -'''is given, the apparent size of the smallest drive given is used. +.\"If the +.\".B \-\-size +.\"option is given, it is not necessary to list any component-devices in this command. +.\"They can be added later, before a +.\".B \-\-run. +.\"If no +.\".B \-\-size +.\"is given, the apparent size of the smallest drive given is used. + +When creating an array within a +.B CONTAINER +.I mdadm +can be given either the list of devices to use, or simply the name of +the container. The former case gives control over which devices in +the container will be used for the array. The latter case allows +.I mdadm +to automatically choose which devices to use based on how much spare +space is available. The General Management options that are valid with .B \-\-create @@ -1465,7 +1563,7 @@ There was an error while trying to get information about the device. .TP .B \-\-examine The device should be a component of an md array. -.B mdadm +.I mdadm will read the md superblock of the device and display the contents. If .B \-\-brief @@ -1523,22 +1621,22 @@ Usage: .PP This usage causes -.B mdadm +.I mdadm to periodically poll a number of md arrays and to report on any events noticed. -.B mdadm +.I mdadm will never exit once it decides that there are arrays to be checked, so it should normally be run in the background. As well as reporting events, -.B mdadm +.I mdadm may move a spare drive from one array to another if they are in the same .B spare-group and if the destination array has a failed drive but no spares. If any devices are listed on the command line, -.B mdadm +.I mdadm will only monitor those devices. Otherwise all arrays listed in the configuration file will be monitored. Further, if .B \-\-scan @@ -1560,11 +1658,11 @@ If .B \-\-scan is given, then a program or an E-mail address must be specified on the command line or in the config file. If neither are available, then -.B mdadm +.I mdadm will not monitor anything. Without .B \-\-scan, -.B mdadm +.I mdadm will continue monitoring as long as something was found to monitor. If no program or email is given, then each event is reported to .BR stdout . @@ -1687,7 +1785,7 @@ For the second device is the array that the spare was moved from. For -.B mdadm +.I mdadm to move spares from one array to another, the different arrays need to be labeled with the same .B spare-group @@ -1697,7 +1795,7 @@ name can be any string; it is only necessary that different spare groups use different names. When -.B mdadm +.I mdadm detects that an array in a spare group has fewer active devices than necessary for the complete array, and has no spare devices, it will look for another array in the same spare group that @@ -1719,12 +1817,16 @@ Currently the only support available is to change the "size" attribute for RAID1, RAID5 and RAID6. .IP \(bu 4 -increase the "raid-disks" attribute of RAID1, RAID5, and RAID6. +increase the "raid\-devices" attribute of RAID1, RAID5, and RAID6. .IP \(bu 4 add a write-intent bitmap to any array which supports these bitmaps, or remove a write-intent bitmap from such an array. .PP +GROW mode is not currently supported for +.B CONTAINERS +or arrays inside containers. + .SS SIZE CHANGES Normally when an array is built the "size" it taken from the smallest of the drives. If all the small drives in an arrays are, one at a @@ -1803,6 +1905,13 @@ passed to .B "mdadm \-\-incremental" to be conditionally added to an appropriate array. +If the device passed is a +.B CONTAINER +device created by a previous call to +.IR mdadm , +then rather than trying to add that device to an array, all the arrays +described by the metadata of the container will be started. + .I mdadm performs a number of tests to determine if the device is part of an array, and which array it should be part of. If an appropriate array @@ -1816,14 +1925,6 @@ will only add devices to an array which were previously working (active or spare) parts of that array. It does not currently support automatic inclusion of a new drive as a spare in some array. -.B "mdadm \-\-incremental" -requires a bug-fix in all kernels through 2.6.19. -Hopefully, this will be fixed in 2.6.20; alternately, apply the patch -which is included with the mdadm source distribution. If -.I mdadm -detects that this bug is present, it will abort any attempt to use -.BR \-\-incremental . - The tests that .I mdadm makes are as follow: @@ -1909,7 +2010,7 @@ that if any devices are missing the array will not be restarted. As an alternative, .B \-\-run may be passed to -.B mdadm +.I mdadm in which case the array will be run as soon as there are enough devices present for the data to be accessible. For a raid1, that means one device will start the array. For a clean raid5, the array @@ -1927,6 +2028,29 @@ that no metadata updates are made and no attempt at resync or recovery happens. Further devices that are found before the first write can still be added safely. + +.SH ENVIRONMENT +This section describes environment variables that affect how mdadm +operates. + +.TP +.B MDADM_NO_MDMON +Setting this value to 1 will prevent mdadm from automatically launching +mdmon. This variable is intended primarily for debugging mdadm/mdmon. + +.TP +.B MDADM_NO_UDEV +Normally, +.I mdadm +does not create any device nodes in /dev, but leaves that task to +.IR udev . +If +.I udev +appears not to be configured, or if this environment variable is set +to '1', the +.I mdadm +will create and devices that are needed. + .SH EXAMPLES .B " mdadm \-\-query /dev/name-of-device" @@ -2017,6 +2141,24 @@ can be started. Any devices which are components of /dev/md4 will be marked as faulty and then remove from the array. +.B " mdadm --create /dev/md/ddf --metadata=ddf --raid-disks 6 /dev/sd[a-f]" +.br +Create a DDF array over 6 devices. + +.B " mdadm --create /dev/md/home -n3 -l5 -z 30000000 /dev/md/ddf" +.br +Create a raid5 array over any 3 devices in the given DDF set. Use +only 30 gigabytes of each device. + +.B " mdadm -A /dev/md/ddf1 /dev/sd[a-f]" +.br +Assemble a pre-exist ddf array. + +.B " mdadm -I /dev/md/ddf1" +.br +Assemble all arrays contained in the ddf array, assigning names as +appropriate. + .B " mdadm \-\-create \-\-help" .br Provide help about the Create mode. @@ -2039,7 +2181,7 @@ If you're using the filesystem, .B /proc/mdstat lists all active md devices with information about them. -.B mdadm +.I mdadm uses this to find arrays when .B \-\-scan is given in Misc mode, and to monitor array reconstruction @@ -2066,71 +2208,92 @@ is used instead. .SH DEVICE NAMES -While entries in the /dev directory can have any format you like, .I mdadm -has an understanding of 'standard' formats which it uses to guide its -behaviour when creating device files via the -.B \-\-auto -option. +understand two sorts of names for array devices. + +The first is the so-called 'standard' format name, which matches the +names used by the kernel and which appear in +.IR /proc/mdstat . + +The second sort can be freely chosen, but must reside in +.IR /dev/md/ . +When giving a device name to +.I mdadm +to create or assemble an array, either full path name such as +.I /dev/md0 +or +.I /dev/md/home +can be given, or just the suffix of the second sort of name, such as +.I home +can be given. + +When +.I mdadm +chooses device names during auto-assembly, it will normally add a +small sequence number to the end of the name to avoid conflicted +between multiple arrays that have the same name. If +.I mdadm +can reasonably determine that the array really is meant for this host, +either by a hostname in the metadata, or by the presence of the array +in /etc/mdadm.conf, then it will leave of the suffix if possible. The standard names for non-partitioned arrays (the only sort of md -array available in 2.4 and earlier) are either of +array available in 2.4 and earlier) are of the form .IP /dev/mdNN -.br -/dev/md/NN .PP where NN is a number. The standard names for partitionable arrays (as available from 2.6 -onwards) are either of +onwards) are of the form .IP -/dev/md/dNN -.br /dev/md_dNN .PP Partition numbers should be indicated by added "pMM" to these, thus "/dev/md/d1p2". +.PP +From kernel version, 2.6.28 the "non-partitioned array" can actually +be partitioned. So the "md_dNN" names are no longer needed, and +partitions such as "/dev/mdNNpXX" are possible. .SH NOTE -.B mdadm +.I mdadm was previously known as -.BR mdctl . +.IR mdctl . .P -.B mdadm +.I mdadm is completely separate from the -.B raidtools +.I raidtools package, and does not use the .I /etc/raidtab configuration file at all. .SH SEE ALSO -For information on the various levels of -RAID, check out: - +For further information on mdadm usage, MD and the various levels of +RAID, see: .IP -.UR http://ostenfeld.dk/~jakob/Software\-RAID.HOWTO/ -http://ostenfeld.dk/~jakob/Software\-RAID.HOWTO/ -.UE -'''.PP -'''for new releases of the RAID driver check out: -''' -'''.IP -'''.UR ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches -'''ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches -'''.UE -'''.PP -'''or -'''.IP -'''.UR http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/ -'''http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/ -'''.UE +.B http://linux\-raid.osdl.org/ +.PP +(based upon Jakob \(/Ostergaard's Software\-RAID.HOWTO) +.\".PP +.\"for new releases of the RAID driver check out: +.\" +.\".IP +.\".UR ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches +.\"ftp://ftp.kernel.org/pub/linux/kernel/people/mingo/raid-patches +.\".UE +.\".PP +.\"or +.\".IP +.\".UR http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/ +.\"http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/ +.\".UE .PP The latest version of .I mdadm should always be available from .IP -.UR http://www.kernel.org/pub/linux/utils/raid/mdadm/ -http://www.kernel.org/pub/linux/utils/raid/mdadm/ -.UE +.B http://www.kernel.org/pub/linux/utils/raid/mdadm/ +.PP +Related man pages: .PP .IR mdadm.conf (5), .IR md (4).