a->info.array.raid_disks = mdstat->raid_disks;
// MORE
- if (a->check_degraded && !frozen) {
+ /* honor 'frozen' */
+ if (sysfs_get_str(&a->info, NULL, "metadata_version", buf, sizeof(buf)) > 0)
+ frozen = buf[9] == '-';
+ else
+ frozen = 1; /* can't read metadata_version assume the worst */
+
+ /* If sync_action is not 'idle' then don't try recovery now */
+ if (!frozen
+ && sysfs_get_str(&a->info, NULL, "sync_action", buf, sizeof(buf)) > 0
+ && strncmp(buf, "idle", 4) != 0)
+ frozen = 1;
+
+ if (mdstat->level) {
+ int level = map_name(pers, mdstat->level);
+ if (a->info.array.level != level && level >= 0) {
+ struct active_array *newa = duplicate_aa(a);
+ if (newa) {
+ newa->info.array.level = level;
+ replace_array(a->container, a, newa);
+ a = newa;
+ }
+ }
+ }
+
- * might container a change (such as a spare assignment) which
+ /* We don't check the array while any update is pending, as it
- if (a->check_degraded &&
++ * might container a change (such as a spare assignment) which
+ * could affect our decisions.
+ */
++ if (a->check_degraded && !frozen &&
+ update_queue == NULL && update_queue_pending == NULL) {
struct metadata_update *updates = NULL;
struct mdinfo *newdev = NULL;
struct active_array *newa;
are synchronised.
Note that when an array changes size, any filesystem that may be
- stored in the array will not automatically grow to use the space. The
- filesystem will need to be explicitly told to use the extra space.
+ stored in the array will not automatically grow for shrink to use or
-vacate the space. The
++vacate the space. The
+ filesystem will need to be explicitly told to use the extra space
+ after growing, or to reduce its size
+ .B prior
+ to shrinking the array.
Also the size of an array cannot be changed while it has an active
bitmap. If an array has a bitmap, it must be removed before the size
an interrupted "reshape". From 2.6.31, the Linux Kernel is able to
increase or decrease the number of devices in a RAID5 or RAID6.
+From 2.6.35, the Linux Kernel is able to convert a RAID0 in to a RAID4
+or RAID5.
+.I mdadm
+uses this functionality and the ability to add
+devices to a RAID4 to allow devices to be added to a RAID0. When
+requested to do this,
+.I mdadm
+will convert the RAID0 to a RAID4, add the necessary disks and make
+the reshape happen, and then convert the RAID4 back to RAID0.
+
When decreasing the number of devices, the size of the array will also
decrease. If there was data in the array, it could get destroyed and
- this is not reversible. To help prevent accidents,
+ this is not reversible, so you should firstly shrink the filesystem on
+ the array to fit within the new size. To help prevent accidents,
.I mdadm
requires that the size of the array be decreased first with
.BR "mdadm --grow --array-size" .