linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Adding a device to an active RAID1 array
@ 2006-01-18 18:58 Bill Cizek
  2006-01-18 23:31 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Cizek @ 2006-01-18 18:58 UTC (permalink / raw)
  To: linux-raid


Hi,

Are there any known issues with changing the number of active devices in 
a RAID1 array?

I'm trying to add a third mirror to an existing RAID1 array of two disks.

I have /dev/md5 as a mirrored pair of two 40 GB disks.  Directly on top 
of it is a 40 GB XFS filesystem.

When I do "mdadm --grow /dev/md5 -n 3" the count of devices changes from 
2 to 3, as expected.
If the XFS filesystem is mounted, the array size changes to 3.0 GB.
If it is not mounted everything works fine.

Is this supposed to work, is it required that the array be inactive to 
add a disk, or am I just doing
something stupid?

If there is a better forum for this question, please direct me there.
In any case TIA for any help.

-Bill




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

* Re: Adding a device to an active RAID1 array
  2006-01-18 18:58 Adding a device to an active RAID1 array Bill Cizek
@ 2006-01-18 23:31 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2006-01-18 23:31 UTC (permalink / raw)
  To: Bill Cizek; +Cc: linux-raid

On Wednesday January 18, cizek@rcn.com wrote:
> 
> Hi,
> 
> Are there any known issues with changing the number of active devices in 
> a RAID1 array?

There is now, thanks.

> 
> I'm trying to add a third mirror to an existing RAID1 array of two disks.
> 
> I have /dev/md5 as a mirrored pair of two 40 GB disks.  Directly on top 
> of it is a 40 GB XFS filesystem.
> 
> When I do "mdadm --grow /dev/md5 -n 3" the count of devices changes from 
> 2 to 3, as expected.
> If the XFS filesystem is mounted, the array size changes to 3.0 GB.
> If it is not mounted everything works fine.
> 
> Is this supposed to work, is it required that the array be inactive to 
> add a disk, or am I just doing
> something stupid?

It is supposed to work, it doesn't, but it is the code doing something
stupid, not you.
Try the patch below.

> 
> If there is a better forum for this question, please direct me there.
> In any case TIA for any help.

This is exactly the correct forum.

NeilBrown

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~	2006-01-17 17:42:31.000000000 +1100
+++ ./drivers/md/md.c	2006-01-19 10:29:46.000000000 +1100
@@ -3488,7 +3488,7 @@ static int update_raid_disks(mddev_t *md
 		bdev = bdget_disk(mddev->gendisk, 0);
 		if (bdev) {
 			mutex_lock(&bdev->bd_inode->i_mutex);
-			i_size_write(bdev->bd_inode, mddev->array_size << 10);
+			i_size_write(bdev->bd_inode, (loff_t)mddev->array_size << 10);
 			mutex_unlock(&bdev->bd_inode->i_mutex);
 			bdput(bdev);
 		}

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

end of thread, other threads:[~2006-01-18 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-18 18:58 Adding a device to an active RAID1 array Bill Cizek
2006-01-18 23:31 ` Neil Brown

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).