Hi,
在 2025/01/30 0:12, pgnd 写道:
Layout : far=2
Chunk Size : 512K
I assume you created the array with layout=f2, and this layout doesn't
support resize. mdadm in my VM print the error message:
[root@fedora ~]# mdadm --grow /dev/md0 --size=max
mdadm: failed to write '0' to '/sys/block/md0/md//component_size'
(Invalid argument)
mdadm: Cannot set device size for /dev/md0: Invalid argument
The error is returned from kernel:
static int raid10_resize(struct mddev *mddev, sector_t sectors)
{
/* Resize of 'far' arrays is not supported.
┊* For 'near' and 'offset' arrays we can set the
┊* number of sectors used to be an appropriate multiple
┊* of the chunk size.
┊* For 'offset', this is far_copies*chunksize.
┊* For 'near' the multiplier is the LCM of
┊* near_copies and raid_disks.
┊* So if far_copies > 1 && !far_offset, fail.
┊* Else find LCM(raid_disks, near_copy)*far_copies and
┊* multiply by chunk_size. Then round to this number.
┊* This is mostly done by raid10_size()
┊*/
if (conf->geo.far_copies > 1 && !conf->geo.far_offset)
return -EINVAL;
Thanks,
Kuai