Grow_reshape: Add r0 grow size error message and update man

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>
This commit is contained in:
Mateusz Kusiak 2022-03-23 15:05:19 +01:00 committed by Jes Sorensen
parent 5ce5a15f0b
commit fea026b484
2 changed files with 18 additions and 7 deletions

6
Grow.c
View File

@ -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)) {

View 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