]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow_reshape: Add r0 grow size error message and update man
authorMateusz Kusiak <mateusz.kusiak@intel.com>
Wed, 23 Mar 2022 14:05:19 +0000 (15:05 +0100)
committerJes Sorensen <jsorensen@fb.com>
Thu, 31 Mar 2022 15:38:30 +0000 (11:38 -0400)
Grow size on r0 is not supported for imsm and native metadata.
Add proper error message.
Update man for proper use of --size.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c
mdadm.8.in

diff --git a/Grow.c b/Grow.c
index 9a947204cccee887d7d10785d4bd956d5661094c..aa72490b8968358604a8d908691704cb5e08779b 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1998,6 +1998,12 @@ int Grow_reshape(char *devname, int fd,
                        goto release;
                }
 
+               if (array.level == 0) {
+                       pr_err("Component size change is not supported for RAID0\n");
+                       rv = 1;
+                       goto release;
+               }
+
                if (reshape_super(st, s->size, UnSet, UnSet, 0, 0, UnSet, NULL,
                                  devname, APPLY_METADATA_CHANGES,
                                  c->verbose > 0)) {
index be902dba8f7f5fd315514d73e5821aab8178f692..e2a4242543f244911466c122facf42ea605973f1 100644 (file)
@@ -459,7 +459,8 @@ number of spare devices.
 
 .TP
 .BR \-z ", " \-\-size=
-Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6.
+Amount (in Kilobytes) of space to use from each drive in RAID levels 1/4/5/6/10
+and for RAID 0 on external metadata.
 This must be a multiple of the chunk size, and must leave about 128Kb
 of space at the end of the drive for the RAID superblock.
 If this is not specified
@@ -478,10 +479,19 @@ To guard against this it can be useful to set the initial size
 slightly smaller than the smaller device with the aim that it will
 still be larger than any replacement.
 
+This option can be used with
+.B \-\-create
+for determining initial size of an array. For external metadata,
+it can be used on a volume, but not on a container itself.
+Setting initial size of
+.B RAID 0
+array is only valid for external metadata.
+
 This value can be set with
 .B \-\-grow
-for RAID level 1/4/5/6 though
+for RAID level 1/4/5/6/10 though
 DDF arrays may not be able to support this.
+RAID 0 array size cannot be changed.
 If the array was created with a size smaller than the currently
 active drives, the extra space can be accessed using
 .BR \-\-grow .
@@ -501,11 +511,6 @@ problems the array can be made bigger again with no loss with another
 .B "\-\-grow \-\-size="
 command.
 
-This value cannot be used when creating a
-.B CONTAINER
-such as with DDF and IMSM metadata, though it perfectly valid when
-creating an array inside a container.
-
 .TP
 .BR \-Z ", " \-\-array\-size=
 This is only meaningful with