Howto start reshape from 100% when change readonly raid to readwrite

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

 



I met a prolem which confused me long time.
Background:
I have two machines which connected to the same HDDs, both of them are
linux software raid. Machine 1 called Master, Machine 2 called Slave.
Master can readwrite the HDD, Slave can read the HDD only.

/dev/md1 was  created on Master, and level is raid5 with 3 active
disks + 1 spare disk. On slave I assemble the md1 as readonly with the
same disks.Here is my steps:
Create md1(raid5) on Master:
#mdadm --create /dev/md1 -l 5 -n 3 -x 1 /dev/sd[bcde]
Assemble md1(raid5) as readonly on Slave:
#mdadm -A /dev/md1 /dev/sd[bcde] -o


When Master doing the reshape(#mdadm --grow --raid-devices 4 /dev/md1
), Slave need to do the same reshape( #mdadm --grow --raid-devices 4
/dev/md1).But md on Slave is readonly, so md_do_sync() not start.
After Master finish the reshape, all data has moved from 3disks to
4disks. How can I ask Slave's md1 to start the reshape from 100% after
set it to readwrite ? Here is my steps:

1.On Slave, I modify the reshape_position_store() of md.c in kernel,
to let user space to set reshape_position to “none” (100%):
static ssize_t
reshape_position_store(struct mddev *mddev, const char *buf, size_t len)
{
…
if (cmd_match(buf, “none”))
;
else if (buf == e || (*e && *e != ‘\n’))
return -EINVAL;

if (cmd_match(buf, “none”))
mddev->reshape_position = MaxSector;
else
mddev->reshape_position = new;
…
}
#echo none > /sys/block/md1/md/reshape_position

2. change readonly raid to readwrite on Slave
#mdadm –readwrite /dev/md1


Result: the reshape didn’t start . Slave's md1 size still the old size
( with 3 disk size)



BRs,
AppleYin
--
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