Linux RAID subsystem development
 help / color / mirror / Atom feed
* Question regarding the adding of drives to a RAID
@ 2004-03-16 22:58 Mark Cuss
  2004-03-16 23:18 ` Neil Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Cuss @ 2004-03-16 22:58 UTC (permalink / raw)
  To: linux-raid

Hello

I've read through the Software RAID HowTo (a very helpful document) and
searched through the mailing list, but haven't been able to find the answer
to my question, so here goes:

Suppose I have a RAID 1 (striping) RAID set up consisting of two drives,
creaiedby editing raidtab and issuing an mkraid, etc.  Suppose I've made an
ext3 filesystem on this device and have files on it.

Now, suppose this RAID device is full, and I wish to make it bigger.  Is
there a way for me to add another pair of drives to this array?  I've tried
doing a "raidhotadd" on my experimental box, that that didn't work.  Later
reading revealed that raidhotadd is only for adding spares.  I don't think
simply adding the new drives to the raidtab will help, as those changes will
only become effective if I mkraid the device, which will torch the data on
it.

Is it possible to do this, or am I dreaming?

Thanks

Mark

Mark Cuss, B. Sc.
Real Time Systems Analyst
System Administrator
CDL Systems Ltd
Suite 230
3553 - 31 Street NW
Calgary, AB, Canada

Phone: 403 289 1733 ext 226
Fax: 403 282 1238
www.cdlsystems.com



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

* Re: Question regarding the adding of drives to a RAID
  2004-03-16 22:58 Question regarding the adding of drives to a RAID Mark Cuss
@ 2004-03-16 23:18 ` Neil Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2004-03-16 23:18 UTC (permalink / raw)
  To: mcuss; +Cc: linux-raid

On Tuesday March 16, mcuss@cdlsystems.com wrote:
> Hello
> 
> I've read through the Software RAID HowTo (a very helpful document) and
> searched through the mailing list, but haven't been able to find the answer
> to my question, so here goes:
> 
> Suppose I have a RAID 1 (striping) RAID set up consisting of two drives,
> creaiedby editing raidtab and issuing an mkraid, etc.  Suppose I've made an
> ext3 filesystem on this device and have files on it.
> 
> Now, suppose this RAID device is full, and I wish to make it bigger.  Is
> there a way for me to add another pair of drives to this array?  I've tried
> doing a "raidhotadd" on my experimental box, that that didn't work.  Later
> reading revealed that raidhotadd is only for adding spares.  I don't think
> simply adding the new drives to the raidtab will help, as those changes will
> only become effective if I mkraid the device, which will torch the data on
> it.
> 
> Is it possible to do this, or am I dreaming?

You are dreaming.

It is possible that something like this might be added one day, but
not in the immediate future.

If you used LVM over raid, you might be able to do something there.

What you could do is:

Assuming first two drives are A and B, and new drives are X and Y.
And that A+B is a raid1 called /dev/md0
and that md1 md2 md3 are not in used.

1/ break the mirror:
	mdadm /dev/md0 -f /dev/B
	mdadm /dev/md0 -r /dev/B

2/ Create md1 and md2 and mirrors of old and new drives
   respectively, but don't include A yet:

	mdadm -C /dev/md1 -l1 -n2 missing /dev/B
	mdadm -C /dev/md2 -l1 -n2 /dev/X /dev/Y

3/ raid0 md1 and m2 together into a raid0

	mdadm -C /dev/md3 -l0 -n2 /dev/md1 /dev/md2

4/ mkfs a filesystem on /dev/md3 and copy you filesystem across

	mkfs -J /dev/md3
	mount /dev/md3 /mnt
	cp -ax /path/to/dev/md0/mountpoint /mnt
	umount /mnt

5/ unmount all and remount new
	unmount /path/to/dev/md0/mountpoint
	mount /dev/md3 /path/to/dev/md0/mountpoint

6/ make sure the data look ok

7/ put A into it's raid1 array
	mdadm /dev/md1 -A /dev/A

8/ make sure the arrays are assembled properly at boot time.

NeilBrown

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

end of thread, other threads:[~2004-03-16 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-16 22:58 Question regarding the adding of drives to a RAID Mark Cuss
2004-03-16 23:18 ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox