linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Howto start reshape from 100% when change readonly raid to readwrite
@ 2014-09-11  3:06 Apple Yin
  2014-09-12  4:05 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Apple Yin @ 2014-09-11  3:06 UTC (permalink / raw)
  To: linux-raid

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-12  4:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11  3:06 Howto start reshape from 100% when change readonly raid to readwrite Apple Yin
2014-09-12  4:05 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).