mdadm: unable to grow array more than once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a raid1 array composed with 2 disks which has 931GB size
At first, I created this array with --size=5G and --metadata=1.0 set
after that I grew the array to --size=10G and it succeed.
Then I grew the array again to --size=20G 
but it failed this time with the following message

mdadm: Cannot set device size for /dev/md0: No space left on device

after I traced the code, I found it was because the following code

int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
   /* skip */
for (mdi = sra->devs; mdi; mdi = mdi->next) {
        sysfs_set_num(sra, mdi, "size", s->size == MAX_SIZE ? 0
                      : s->size);

this changed the value of rdev->size from 1933615488 to 20971520 at first grow 
but second grow was limited by kernel when mdadm tried to set 41943040 to size

static unsigned long long
super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
                /* skip */
             max_sectors = rdev->sectors + sb_start - rdev->sb_start;
                                     ^^^^^^^^^^^^^
                                        20971520
             if (!num_sectors || num_sectors > max_sectors)
                           num_sectors = max_sectors;

seems like there's no way this array can be grown again.

I know setting size sysfs attribute is to inform kernel the size of member
device has changed, but under this circumstance, should mdadm also
have to know the changing size is the device size or just the size user 
want to use on this device?

Thanks,
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux