~xnox/ubuntu/quantal/mdadm/merge

« back to all changes in this revision

Viewing changes to mdadm.8.in

  • Committer: Dmitrijs Ledkovs
  • Author(s): Clint Byrum
  • Date: 2011-12-16 11:06:12 UTC
  • mfrom: (1.1.26 sid)
  • Revision ID: dmitrijs.ledkovs@canonical.com-20111216110612-f91bfvyfvxc1t0rq
Tags: 3.2.2-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Call checks in local-premount to avoid race condition with udev
    and opening a degraded array.
  - d/initramfs/mdadm-functions: Record in /run when boot-degraded 
    question has been asked so that it is only asked once
  - pass --test to mdadm to enable result codes for degraded arrays. 
  - Build udeb with -O2 on ppc64, working around a link error.
  - debian/control: we need udev and util-linux in the right version. We
    also remove the build dependency from quilt and docbook-to-man as both
    are not used in Ubuntus mdadm.
  - debian/initramfs/hook: kept the Ubuntus version for handling the absence
    of active raid arrays in <initramfs>/etc/mdadm/mdadm.conf
  - debian/initramfs/script.local-top.DEBIAN, debian/mdadm-startall,
    debian/mdadm.raid.DEBIAN: removed. udev does its job now instead.
  - debian/mdadm-startall.sgml, debian/mdadm-startall.8: documentation of
    unused startall script
  - debian/mdadm.config, debian/mdadm.postinst - let udev do the handling
    instead. Resolved merge conflict by keeping Ubuntu's version.
  - debian/mdadm.postinst, debian/mdadm.config, initramfs/init-premount:
    boot-degraded enablement; maintain udev starting of RAID devices;
    init-premount hook script for the initramfs, to provide information at
    boot
  - debian/mkconf.in is the older mkconf. Kept the Ubuntu version.
  - debian/rules: Kept Ubuntus version for installing apport hooks, not
    installing un-used startall script and for adding a udev rule
    corresponding to mdadm.
  - debian/install-rc, check.d/_numbers, check.d/root_on_raid: Ubuntu partman
    installer changes
  - debian/presubj: Dropped this unused bug reporting file. Instead use
    source_mdadm.py act as an apport hook for bug handling.
  - rename debian/mdadm.vol_id.udev to debian/mdadm.mdadm-blkid.udev so that
    the rules file ends up with a more reasonable name
  - d/p/debian-changes-3.1.4-1+8efb9d1ubuntu4: mdadm udev rule
    incrementally adds mdadm member when detected. Starting such an
    array in degraded mode is possible by mdadm -IRs. Using mdadm
    -ARs without stopping the array first does nothing when no
    mdarray-unassociated device is available. Using mdadm -IRs to
    start a previously partially assembled array through incremental
    mode. Keeping the mdadm -ARs for assembling arrays which were for
    some reason not assembled through incremental mode (i.e through
    mdadm's udev rule).
* Disabling -fno-strict-aliasing as according to debian bug 375876 it
  has been unnecessary since mdadm 2.5.2
* Dropped changes:
  - applied upstream
  - d/rules: fix FTBFS by adding -Wno-unused-but-set-variable to
    compiler flags until upstream solves the issue. (fixed upstream)
  - d/control: add dependency on initscripts >= 2.88dsf-13.3 to ensure
    /run exists per http://wiki.debian.org/ReleaseGoals/RunDirectory
    (change also done in debian)
* d/rules: add 'man' to build mdadm.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
.\"   the Free Software Foundation; either version 2 of the License, or
6
6
.\"   (at your option) any later version.
7
7
.\" See file COPYING in distribution for details.
8
 
.TH MDADM 8 "" v3.1.4
 
8
.TH MDADM 8 "" v3.2.2
9
9
.SH NAME
10
10
mdadm \- manage MD devices
11
11
.I aka
122
122
.B "Grow"
123
123
Grow (or shrink) an array, or otherwise reshape it in some way.
124
124
Currently supported growth options including changing the active size
125
 
of component devices and changing the number of active devices in RAID
126
 
levels 1/4/5/6, changing the RAID level between 1, 5, and 6, changing
127
 
the chunk size and layout for RAID5 and RAID5, as well as adding or
 
125
of component devices and changing the number of active devices in
 
126
Linear and RAID levels 0/1/4/5/6,
 
127
changing the RAID level between 0, 1, 5, and 6, and between 0 and 10,
 
128
changing the chunk size and layout for RAID 0,4,5,6, as well as adding or
128
129
removing a write-intent bitmap.
129
130
 
130
131
.TP
322
323
..
323
324
Use the original 0.90 format superblock.  This format limits arrays to
324
325
28 component devices and limits component devices of levels 1 and
325
 
greater to 2 terabytes.
 
326
greater to 2 terabytes.  It is also possible for there to be confusion
 
327
about whether the superblock applies to a whole device or just the
 
328
last partition, if that partition starts on a 64K boundary.
326
329
.ie '{DEFAULT_METADATA}'0.90'
327
330
.IP "1, 1.0, 1.1, 1.2"
328
331
.el
329
332
.IP "1, 1.0, 1.1, 1.2 default"
330
333
..
331
 
Use the new version-1 format superblock.  This has few restrictions.
332
 
The different sub-versions store the superblock at different locations
333
 
on the device, either at the end (for 1.0), at the start (for 1.1) or
334
 
4K from the start (for 1.2).  "1" is equivalent to "1.0".
 
334
Use the new version-1 format superblock.  This has fewer restrictions.
 
335
It can easily be moved between hosts with different endian-ness, and a
 
336
recovery operation can be checkpointed and restarted.  The different
 
337
sub-versions store the superblock at different locations on the
 
338
device, either at the end (for 1.0), at the start (for 1.1) or 4K from
 
339
the start (for 1.2).  "1" is equivalent to "1.0".
335
340
'if '{DEFAULT_METADATA}'1.2'  "default" is equivalent to "1.2".
336
341
.IP ddf
337
342
Use the "Industry Standard" DDF (Disk Data Format) format defined by
410
415
size, though if there is a variance among the drives of greater than 1%, a warning is
411
416
issued.
412
417
 
 
418
A suffix of 'M' or 'G' can be given to indicate Megabytes or
 
419
Gigabytes respectively.
 
420
 
413
421
This value can be set with
414
422
.B \-\-grow
415
423
for RAID level 1/4/5/6.  If the array was created with a size smaller
420
428
.B max
421
429
which means to choose the largest size that fits on all current drives.
422
430
 
 
431
Before reducing the size of the array (with
 
432
.BR "\-\-grow \-\-size=" )
 
433
you should make sure that space isn't needed.  If the device holds a
 
434
filesystem, you would need to resize the filesystem to use less space.
 
435
 
 
436
After reducing the array size you should check that the data stored in
 
437
the device is still available.  If the device holds a filesystem, then
 
438
an 'fsck' of the filesystem is a minimum requirement.  If there are
 
439
problems the array can be made bigger again with no loss with another
 
440
.B "\-\-grow \-\-size="
 
441
command.
 
442
 
423
443
This value can not be used with
424
444
.B CONTAINER
425
445
metadata such as DDF and IMSM.
426
446
 
427
447
.TP
428
 
.BR \-Z ", " \-\-array-size=
 
448
.BR \-Z ", " \-\-array\-size=
429
449
This is only meaningful with
430
450
.B \-\-grow
431
 
and its effect is not persistent: when the array is stopped an
 
451
and its effect is not persistent: when the array is stopped and
432
452
restarted the default array size will be restored.
433
453
 
434
454
Setting the array-size causes the array to appear smaller to programs
439
459
is, it is required that the array size is reduced as appropriate
440
460
before the number of devices in the array is reduced.
441
461
 
 
462
Before reducing the size of the array you should make sure that space
 
463
isn't needed.  If the device holds a filesystem, you would need to
 
464
resize the filesystem to use less space.
 
465
 
 
466
After reducing the array size you should check that the data stored in
 
467
the device is still available.  If the device holds a filesystem, then
 
468
an 'fsck' of the filesystem is a minimum requirement.  If there are
 
469
problems the array can be made bigger again with no loss with another
 
470
.B "\-\-grow \-\-array\-size="
 
471
command.
 
472
 
 
473
A suffix of 'M' or 'G' can be given to indicate Megabytes or
 
474
Gigabytes respectively.
 
475
A value of
 
476
.B max
 
477
restores the apparent size of the array to be whatever the real
 
478
amount of available space is.
 
479
 
442
480
.TP
443
481
.BR \-c ", " \-\-chunk=
444
482
Specify chunk size of kibibytes.  The default when creating an
446
484
default when Building and array with no persistent metadata is 64KB.
447
485
This is only meaningful for RAID0, RAID4, RAID5, RAID6, and RAID10.
448
486
 
 
487
RAID4, RAID5, RAID6, and RAID10 require the chunk size to be a power
 
488
of 2.  In any case it must be a multiple of 4KB.
 
489
 
 
490
A suffix of 'M' or 'G' can be given to indicate Megabytes or
 
491
Gigabytes respectively.
 
492
 
449
493
.TP
450
494
.BR \-\-rounding=
451
495
Specify rounding factor for a Linear array.  The size of each
493
537
The default is
494
538
.BR left\-symmetric .
495
539
 
496
 
It is also possibly to cause RAID5 to use a RAID4-like layout by
 
540
It is also possible to cause RAID5 to use a RAID4-like layout by
497
541
choosing
498
542
.BR parity\-first ,
499
543
or
618
662
bitmap, the chunksize defaults to 64Meg, or larger if necessary to
619
663
fit the bitmap into the available space.
620
664
 
 
665
A suffix of 'M' or 'G' can be given to indicate Megabytes or
 
666
Gigabytes respectively.
 
667
 
621
668
.TP
622
669
.BR \-W ", " \-\-write\-mostly
623
670
subsequent devices listed in a
655
702
actually clean. If that is the case, such as after running
656
703
badblocks, this argument can be used to tell mdadm the
657
704
facts the operator knows.
 
705
.IP
 
706
When an array is resized to a larger size with
 
707
.B "\-\-grow \-\-size="
 
708
the new space is normally resynced in that same way that the whole
 
709
array is resynced at creation.  From Linux version 2.6.40,
 
710
.B \-\-assume\-clean
 
711
can be used with that command to avoid the automatic resync.
658
712
 
659
713
.TP
660
714
.BR \-\-backup\-file=
661
715
This is needed when
662
716
.B \-\-grow
663
 
is used to increase the number of
664
 
raid-devices in a RAID5 if there are no spare devices available.
665
 
See the GROW MODE section below on RAID\-DEVICES CHANGES.  The file
666
 
should be stored on a separate device, not on the RAID array being
667
 
reshaped.
668
 
 
669
 
.TP
670
 
.BR \-\-array-size= ", " \-Z
671
 
Set the size of the array which is seen by users of the device such as
672
 
filesystems.  This can be less that the real size, but never greater.
673
 
The size set this way does not persist across restarts of the array.
674
 
 
675
 
This is most useful when reducing the number of devices in a RAID5 or
676
 
RAID6.  Such arrays require the array-size to be reduced before a
677
 
reshape can be performed that reduces the real size.
678
 
 
679
 
A value of
680
 
.B max
681
 
restores the apparent size of the array to be whatever the real
682
 
amount of available space is.
 
717
is used to increase the number of raid-devices in a RAID5 or RAID6 if
 
718
there are no spare devices available, or to shrink, change RAID level
 
719
or layout.  See the GROW MODE section below on RAID\-DEVICES CHANGES.
 
720
The file must be stored on a separate device, not on the RAID array
 
721
being reshaped.
683
722
 
684
723
.TP
685
724
.BR \-N ", " \-\-name=
873
912
See this option under Create and Build options.
874
913
 
875
914
.TP
 
915
.BR \-a ", " "\-\-add"
 
916
This option can be used in Grow mode in two cases.
 
917
 
 
918
If the target array is a Linear array, then
 
919
.B \-\-add
 
920
can be used to add one or more devices to the array.  They
 
921
are simply catenated on to the end of the array.  Once added, the
 
922
devices cannot be removed.
 
923
 
 
924
If the
 
925
.B \-\-raid\-disks
 
926
option is being used to increase the number of devices in an array,
 
927
then
 
928
.B \-\-add
 
929
can be used to add some extra devices to be included in the array.
 
930
In most cases this is not needed as the extra devices can be added as
 
931
spares first, and then the number of raid-disks can be changed.
 
932
However for RAID0, it is not possible to add spares.  So to increase
 
933
the number of devices in a RAID0, it is necessary to set the new
 
934
number of devices, and to add the new devices, in the same command.
 
935
 
 
936
.TP
876
937
.BR \-b ", " \-\-bitmap=
877
938
Specify the bitmap file that was given when the array was created.  If
878
939
an array has an
883
944
.BR \-\-backup\-file=
884
945
If
885
946
.B \-\-backup\-file
886
 
was used to grow the number of raid-devices in a RAID5, and the system
887
 
crashed during the critical section, then the same
 
947
was used while reshaping an array (e.g. changing number of devices or
 
948
chunk size) and the system crashed during the critical section, then the same
888
949
.B \-\-backup\-file
889
950
must be presented to
890
951
.B \-\-assemble
891
 
to allow possibly corrupted data to be restored.
 
952
to allow possibly corrupted data to be restored, and the reshape
 
953
to be completed.
 
954
 
 
955
.TP
 
956
.BR \-\-invalid\-backup
 
957
If the file needed for the above option is not available for any
 
958
reason an empty file can be given together with this option to
 
959
indicate that the backup file is invalid.  In this case the data that
 
960
was being rearranged at the time of the crash could be irrecoverably
 
961
lost, but the rest of the array may still be recoverable.  This option
 
962
should only be used as a last resort if there is no way to recover the
 
963
backup file.
 
964
 
892
965
 
893
966
.TP
894
967
.BR \-U ", " \-\-update=
902
975
.BR resync ,
903
976
.BR byteorder ,
904
977
.BR devicesize ,
 
978
.BR no\-bitmap ,
905
979
or
906
980
.BR super\-minor .
907
981
 
984
1058
 
985
1059
The
986
1060
.B devicesize
987
 
will rarely be of use.  It applies to version 1.1 and 1.2 metadata
 
1061
option will rarely be of use.  It applies to version 1.1 and 1.2 metadata
988
1062
only (where the metadata is at the start of the device) and is only
989
1063
useful when the component device has changed size (typically become
990
1064
larger).  The version 1 metadata records the amount of the device that
998
1072
to determine the maximum usable amount of space on each device and
999
1073
update the relevant field in the metadata.
1000
1074
 
1001
 
.ig
1002
 
.TP
1003
 
.B \-\-auto\-update\-homehost
1004
 
This flag is only meaningful with auto-assembly (see discussion below).
1005
 
In that situation, if no suitable arrays are found for this homehost,
1006
 
.I mdadm
1007
 
will rescan for any arrays at all and will assemble them and update the
1008
 
homehost to match the current host.
1009
 
..
 
1075
The
 
1076
.B no\-bitmap
 
1077
option can be used when an array has an internal bitmap which is
 
1078
corrupt in some way so that assembling the array normally fails.  It
 
1079
will cause any internal bitmap to be ignored.
1010
1080
 
1011
1081
.SH For Manage mode:
1012
1082
 
1029
1099
.BR \-a ", " \-\-add
1030
1100
hot-add listed devices.
1031
1101
If a device appears to have recently been part of the array
1032
 
(possibly it failed or was removed) the device is re-added as describe
 
1102
(possibly it failed or was removed) the device is re\-added as describe
1033
1103
in the next point.
1034
1104
If that fails or the device was never part of the array, the device is
1035
1105
added as a hot-spare.
1055
1125
it will be assumed that bitmap-based recovery is enough to make the
1056
1126
device fully consistent with the array.
1057
1127
 
 
1128
When
 
1129
.B \-\-re\-add
 
1130
can be accompanied by
 
1131
.BR \-\-update=devicesize .
 
1132
See the description of this option when used in Assemble mode for an
 
1133
explanation of its use.
 
1134
 
1058
1135
If the device name given is
1059
1136
.B missing
1060
1137
then mdadm will try to find any device that looks like it should be
1299
1376
not a name in
1300
1377
.IR /dev .
1301
1378
 
 
1379
.TP
 
1380
.BR \-\-path=
 
1381
Only used with \-\-fail.  The 'path' given will be recorded so that if
 
1382
a new device appears at the same location it can be automatically
 
1383
added to the same array.  This allows the failed device to be
 
1384
automatically replaced by a new device without metadata if it appears
 
1385
at specified path.   This option is normally only set by a
 
1386
.I udev
 
1387
script.
 
1388
 
1302
1389
.SH For Monitor mode:
1303
1390
.TP
1304
1391
.BR \-m ", " \-\-mail
1370
1457
passed to the alert program.  This can be used for testing that alert
1371
1458
message do get through successfully.
1372
1459
 
 
1460
.TP
 
1461
.BR \-\-no\-sharing
 
1462
This inhibits the functionality for moving spares between arrays.
 
1463
Only one monitoring process started with
 
1464
.B \-\-scan
 
1465
but without this flag is allowed, otherwise the two could interfere
 
1466
with each other.
 
1467
 
1373
1468
.SH ASSEMBLE MODE
1374
1469
 
1375
1470
.HP 12
1549
1644
.IR mdadm.conf (5)
1550
1645
for further details.
1551
1646
 
1552
 
.ig
1553
 
If
1554
 
.I mdadm
1555
 
cannot find any array for the given host at all, and if
1556
 
.B \-\-auto\-update\-homehost
1557
 
is given, then
1558
 
.I mdadm
1559
 
will search again for any array (not just an array created for this
1560
 
host) and will assemble each assuming
1561
 
.BR \-\-update=homehost .
1562
 
This will change the host tag in the superblock so that on the next run,
1563
 
these arrays will be found without the second pass.  The intention of
1564
 
this feature is to support transitioning a set of md arrays to using
1565
 
homehost tagging.
1566
 
 
1567
 
The reason for requiring arrays to be tagged with the homehost for
1568
 
auto assembly is to guard against problems that can arise when moving
1569
 
devices from one host to another.
1570
 
..
 
1647
Note: Auto assembly cannot be used for assembling and activating some
 
1648
arrays which are undergoing reshape.  In particular as the
 
1649
.B backup\-file
 
1650
cannot be given, any reshape which requires a backup-file to continue
 
1651
cannot be started by auto assembly.  An array which is growing to more
 
1652
devices and has passed the critical section can be assembled using
 
1653
auto-assembly.
1571
1654
 
1572
1655
.SH BUILD MODE
1573
1656
 
1918
2001
may move a spare drive from one array to another if they are in the
1919
2002
same
1920
2003
.B spare-group
 
2004
or
 
2005
.B domain
1921
2006
and if the destination array has a failed drive but no spares.
1922
2007
 
1923
2008
If any devices are listed on the command line,
2024
2109
.B MoveSpare
2025
2110
A spare drive has been moved from one array in a
2026
2111
.B spare-group
 
2112
or
 
2113
.B domain
2027
2114
to another to allow a failed drive to be replaced.
2028
2115
(syslog priority: Info)
2029
2116
 
2076
2163
to move spares from one array to another, the different arrays need to
2077
2164
be labeled with the same
2078
2165
.B spare-group
 
2166
or the spares must be allowed to migrate through matching POLICY domains
2079
2167
in the configuration file.  The
2080
2168
.B spare-group
2081
2169
name can be any string; it is only necessary that different spare
2092
2180
If the removal succeeds but the adding fails, then it is added back to
2093
2181
the original array.
2094
2182
 
 
2183
If the spare group for a degraded array is not defined,
 
2184
.I mdadm
 
2185
will look at the rules of spare migration specified by POLICY lines in
 
2186
.B mdadm.conf
 
2187
and then follow similar steps as above if a matching spare is found.
 
2188
 
2095
2189
.SH GROW MODE
2096
2190
The GROW mode is used for changing the size or shape of an active
2097
2191
array.
2098
2192
For this to work, the kernel must support the necessary change.
2099
 
Various types of growth are being added during 2.6 development,
2100
 
including restructuring a RAID5 array to have more active devices.
 
2193
Various types of growth are being added during 2.6 development.
2101
2194
 
2102
 
Currently the only support available is to
2103
 
.IP \(bu 4
2104
 
change the "size" attribute
2105
 
for RAID1, RAID5 and RAID6.
2106
 
.IP \(bu 4
2107
 
increase or decrease the "raid\-devices" attribute of RAID1, RAID5,
2108
 
and RAID6.
2109
 
.IP \bu 4
2110
 
change the chunk-size and layout of RAID5 and RAID6.
2111
 
.IP \bu 4
2112
 
convert between RAID1 and RAID5, and between RAID5 and RAID6.
 
2195
Currently the supported changes include
 
2196
.IP \(bu 4
 
2197
change the "size" attribute for RAID1, RAID4, RAID5 and RAID6.
 
2198
.IP \(bu 4
 
2199
increase or decrease the "raid\-devices" attribute of RAID0, RAID1, RAID4,
 
2200
RAID5, and RAID6.
 
2201
.IP \bu 4
 
2202
change the chunk-size and layout of RAID0, RAID4, RAID5 and RAID6.
 
2203
.IP \bu 4
 
2204
convert between RAID1 and RAID5, between RAID5 and RAID6, between
 
2205
RAID0, RAID5, and RAID5, and between RAID0 and RAID10 (in the near-2 mode).
2113
2206
.IP \(bu 4
2114
2207
add a write-intent bitmap to any array which supports these bitmaps, or
2115
2208
remove a write-intent bitmap from such an array.
2116
2209
.PP
2117
2210
 
2118
 
GROW mode is not currently supported for
2119
 
.B CONTAINERS
2120
 
or arrays inside containers.
 
2211
Using GROW on containers is currently only support for Intel's IMSM
 
2212
container format.  The number of devices in a container can be
 
2213
increased - which affects all arrays in the container - or an array
 
2214
in a container can be converted between levels where those levels are
 
2215
supported by the container, and the conversion is on of those listed
 
2216
above.
 
2217
 
 
2218
Grow functionality (e.g. expand a number of raid devices) for Intel's
 
2219
IMSM container format has an experimental status. It is guarded by the
 
2220
.B MDADM_EXPERIMENTAL
 
2221
environment variable which must be set to '1' for a GROW command to
 
2222
succeed.
 
2223
This is for the following reasons:
 
2224
 
 
2225
.IP 1.
 
2226
Intel's native IMSM check-pointing is not fully tested yet.
 
2227
This can causes IMSM incompatibility during the grow process: an array
 
2228
which is growing cannot roam between Microsoft Windows(R) and Linux
 
2229
systems.
 
2230
 
 
2231
.IP 2.
 
2232
Interrupting a grow operation is not recommended, because it
 
2233
has not been fully tested for Intel's IMSM container format yet.
 
2234
 
 
2235
.PP
 
2236
Note: Intel's native checkpointing doesn't use
 
2237
.B --backup-file
 
2238
option and it is transparent for assembly feature.
2121
2239
 
2122
2240
.SS SIZE CHANGES
2123
 
Normally when an array is built the "size" it taken from the smallest
 
2241
Normally when an array is built the "size" is taken from the smallest
2124
2242
of the drives.  If all the small drives in an arrays are, one at a
2125
2243
time, removed and replaced with larger drives, then you could have an
2126
2244
array of large drives with only a small amount used.  In this
2130
2248
are synchronised.
2131
2249
 
2132
2250
Note that when an array changes size, any filesystem that may be
2133
 
stored in the array will not automatically grow to use the space.  The
2134
 
filesystem will need to be explicitly told to use the extra space.
 
2251
stored in the array will not automatically grow for shrink to use or
 
2252
vacate the space.  The
 
2253
filesystem will need to be explicitly told to use the extra space
 
2254
after growing, or to reduce its size
 
2255
.B prior
 
2256
to shrinking the array.
2135
2257
 
2136
2258
Also the size of an array cannot be changed while it has an active
2137
2259
bitmap.  If an array has a bitmap, it must be removed before the size
2159
2281
an interrupted "reshape".  From 2.6.31, the Linux Kernel is able to
2160
2282
increase or decrease the number of devices in a RAID5 or RAID6.
2161
2283
 
 
2284
From 2.6.35, the Linux Kernel is able to convert a RAID0 in to a RAID4
 
2285
or RAID5.
 
2286
.I mdadm
 
2287
uses this functionality and the ability to add
 
2288
devices to a RAID4 to allow devices to be added to a RAID0.  When
 
2289
requested to do this,
 
2290
.I mdadm
 
2291
will convert the RAID0 to a RAID4, add the necessary disks and make
 
2292
the reshape happen, and then convert the RAID4 back to RAID0.
 
2293
 
2162
2294
When decreasing the number of devices, the size of the array will also
2163
2295
decrease.  If there was data in the array, it could get destroyed and
2164
 
this is not reversible.  To help prevent accidents,
 
2296
this is not reversible, so you should firstly shrink the filesystem on
 
2297
the array to fit within the new size.  To help prevent accidents,
2165
2298
.I mdadm
2166
2299
requires that the size of the array be decreased first with
2167
2300
.BR "mdadm --grow --array-size" .
2169
2302
inaccessible.  The integrity of any data can then be checked before
2170
2303
the non-reversible reduction in the number of devices is request.
2171
2304
 
2172
 
When relocating the first few stripes on a RAID5, it is not possible
2173
 
to keep the data on disk completely consistent and crash-proof.  To
2174
 
provide the required safety, mdadm disables writes to the array while
2175
 
this "critical section" is reshaped, and takes a backup of the data
2176
 
that is in that section.  This backup is normally stored in any spare
2177
 
devices that the array has, however it can also be stored in a
2178
 
separate file specified with the
 
2305
When relocating the first few stripes on a RAID5 or RAID6, it is not
 
2306
possible to keep the data on disk completely consistent and
 
2307
crash-proof.  To provide the required safety, mdadm disables writes to
 
2308
the array while this "critical section" is reshaped, and takes a
 
2309
backup of the data that is in that section.  For grows, this backup may be
 
2310
stored in any spare devices that the array has, however it can also be
 
2311
stored in a separate file specified with the
2179
2312
.B \-\-backup\-file
2180
 
option.  If this option is used, and the system does crash during the
2181
 
critical period, the same file must be passed to
 
2313
option, and is required to be specified for shrinks, RAID level
 
2314
changes and layout changes.  If this option is used, and the system
 
2315
does crash during the critical period, the same file must be passed to
2182
2316
.B \-\-assemble
2183
 
to restore the backup and reassemble the array.
 
2317
to restore the backup and reassemble the array.  When shrinking rather
 
2318
than growing the array, the reshape is done from the end towards the
 
2319
beginning, so the "critical section" is at the end of the reshape.
2184
2320
 
2185
2321
.SS LEVEL CHANGES
2186
2322
 
2187
2323
Changing the RAID level of any array happens instantaneously.  However
2188
 
in the RAID to RAID6 case this requires a non-standard layout of the
 
2324
in the RAID5 to RAID6 case this requires a non-standard layout of the
2189
2325
RAID6 data, and in the RAID6 to RAID5 case that non-standard layout is
2190
 
required before the change can be accomplish.  So while the level
 
2326
required before the change can be accomplished.  So while the level
2191
2327
change is instant, the accompanying layout change can take quite a
2192
 
long time.
 
2328
long time.  A
 
2329
.B \-\-backup\-file
 
2330
is required.  If the array is not simultaneously being grown or
 
2331
shrunk, so that the array size will remain the same - for example,
 
2332
reshaping a 3-drive RAID5 into a 4-drive RAID6 - the backup file will
 
2333
be used not just for a "cricital section" but throughout the reshape
 
2334
operation, as described below under LAYOUT CHANGES.
2193
2335
 
2194
2336
.SS CHUNK-SIZE AND LAYOUT CHANGES
2195
2337
 
2198
2340
To ensure against data loss in the case of a crash, a
2199
2341
.B --backup-file
2200
2342
must be provided for these changes.  Small sections of the array will
2201
 
be copied to the backup file while they are being rearranged.
 
2343
be copied to the backup file while they are being rearranged.  This
 
2344
means that all the data is copied twice, once to the backup and once
 
2345
to the new layout on the array, so this type of reshape will go very
 
2346
slowly.
2202
2347
 
2203
2348
If the reshape is interrupted for any reason, this backup file must be
2204
 
make available to
 
2349
made available to
2205
2350
.B "mdadm --assemble"
2206
2351
so the array can be reassembled.  Consequently the file cannot be
2207
2352
stored on the device being reshaped.
2262
2407
 
2263
2408
Note that
2264
2409
.I mdadm
2265
 
will only add devices to an array which were previously working
2266
 
(active or spare) parts of that array.  It does not currently support
2267
 
automatic inclusion of a new drive as a spare in some array.
 
2410
will normally only add devices to an array which were previously working
 
2411
(active or spare) parts of that array.  The support for automatic
 
2412
inclusion of a new drive as a spare in some array requires
 
2413
a configuration through POLICY in config file.
2268
2414
 
2269
2415
The tests that
2270
2416
.I mdadm
2296
2442
.I mdadm
2297
2443
finds any known version of metadata.  If no
2298
2444
.I md
2299
 
metadata is found, the device is rejected.
 
2445
metadata is found, the device may be still added to an array
 
2446
as a spare if POLICY allows.
2300
2447
 
2301
2448
.ig
2302
2449
.IP +
2596
2743
.I mdadm
2597
2744
can reasonably determine that the array really is meant for this host,
2598
2745
either by a hostname in the metadata, or by the presence of the array
2599
 
in /etc/mdadm.conf, then it will leave off the suffix if possible.
 
2746
in
 
2747
.BR mdadm.conf ,
 
2748
then it will leave off the suffix if possible.
2600
2749
Also if the homehost is specified as
2601
2750
.B <ignore>
2602
2751
.I mdadm