View previous topic :: View next topic |
Author |
Message |
RaceTM Apprentice
Joined: 16 Feb 2004 Posts: 281
|
Posted: Fri Feb 16, 2007 5:14 pm Post subject: a bit of a RAID issue |
|
|
Hey all,
I havea bit of an issue I am trying to figure out I am hoping that somebody with mdraid experience can give me a hand.
Right now, I have a raid 5 array which consists of 5 250gig drives. I am planning on expanding this array by growing it to 500 gig drives, but I am not able to buy another 5 drives at once. I am trying to figure out the best way to slowly grow the array.
My idea right now is to buy 2 500 gig drives, and modify the array as follows:
current setup (5 nodes):
250 gig
250 gig
250 gig
250 gig
250 gig
new setup (4 nodes):
500 gig
500 gig
(2x250 gig)
(2 x 250 gig)
So basically I would raid 2x250 drives together which would act as a device in the bigger array.
Is this possible? If so, how would I do it without losing any data?
Any help would be appreciated. I am on a kernel > 2.6.17, so from what I understand, I am able to grow my array using mdadm, I am just not sure about how to do it, or how to migrate to the new array structure without losing any data. |
|
Back to top |
|
|
HeissFuss Guru
Joined: 11 Jan 2005 Posts: 414
|
Posted: Fri Feb 16, 2007 6:58 pm Post subject: |
|
|
I assume that you can have at least 6 drives in the system since your final setup will require that.
I've never tried this so don't blame me if it doesn't work/destroys your data/kills your children.
1. Manually fail one of the drives in your current raid5 (make sure you know which physical drive you're failing also.) I won't go into the steps of how to do this. You can read up on it.
2. Shut down the system, remove the drive you failed, install the 2 500gb drives.
3. Boot the system and set up the 2 500gb drives as a raid5 with 1 absent drive (or possible raid0, you may be able to convert that to raid5 also.)
4. Copy your data from the 4x250s to the now 1TB raid5.
5. Create your 2 raid0 arrays on the 4 250s.
6. Add the arrays.
Hopefully that'll work. You may want to read up on if it's possible to add software raid devices to other software raid devices as I've never tried that and this solution kind of depends on that. |
|
Back to top |
|
|
RaceTM Apprentice
Joined: 16 Feb 2004 Posts: 281
|
Posted: Fri Feb 16, 2007 7:13 pm Post subject: |
|
|
Thanks for the reply, that is along the lines of what I was thinking. Here are my questions, however:
1) Why is it necessary to fail one drive on the existing array? It currently only has a capacity of 1Tb
2) As far as I know, building a raid 5 array using 2 disks will give an effective storage capacity of 500gb. Would I then need to transfer over half of my data, somehow shrink the old array, then migrate the rest of the data? |
|
Back to top |
|
|
HeissFuss Guru
Joined: 11 Jan 2005 Posts: 414
|
Posted: Fri Feb 16, 2007 7:53 pm Post subject: |
|
|
If you can have all 7 disks in the system at the same time you don't need to fail a drive. Otherwise you'll need to take 1 out to make room for the others. Manually failing the drive is better than starting up and having a drive missing when the raid thinks it should be there.
Basically a degraded raid5 acts like a raid0 so with 2x500gb and 1 missing you'll have 1TB. |
|
Back to top |
|
|
RaceTM Apprentice
Joined: 16 Feb 2004 Posts: 281
|
Posted: Tue Feb 20, 2007 4:48 pm Post subject: |
|
|
Thanks for the info HeissFuss, I have a bit of an update.
I purchased 2 500 gig drives which are in the mail at the moment. So, it looks like my plan right now is to set up a degraded raid 5 array with the new drives (giving me 1 Tb), transfer files over, then make and add the 2x250 arrays one at a time. I guess my question now is, how do I construct a degraded raid 5 array out of 2 hard disks? |
|
Back to top |
|
|
HeissFuss Guru
Joined: 11 Jan 2005 Posts: 414
|
Posted: Tue Feb 20, 2007 9:54 pm Post subject: |
|
|
To create a degraded raid 5 with mdadm you can just specify "missing" as the third device. See the section on CREATE MODE in the mdadm man page for more details.
mdadm -create /dev/md0 --level=5 --raid-devices=3 /dev/sda1 /dev/sdb1 missing
assuming that your partitions are as such and that the raid5 device you want to create is md0.
To replace the "missing" device later just
mdadm -add /dev/md0 /dev/sdc1
A couple of notes:
Growing the array will probably take a few hours per addition to sync and parity.
Always do cat /proc/mdstat before adding a device to make sure it's done syncing. You should probably not have it mounted either. |
|
Back to top |
|
|
RaceTM Apprentice
Joined: 16 Feb 2004 Posts: 281
|
Posted: Tue Feb 20, 2007 10:31 pm Post subject: |
|
|
perfect, thanks for the advice, HeissFuss. I will give this a shot when the drives get in, and see what happens |
|
Back to top |
|
|
HeissFuss Guru
Joined: 11 Jan 2005 Posts: 414
|
Posted: Tue Feb 20, 2007 10:39 pm Post subject: |
|
|
Also don't forget to make the partitions type fd (Linux raid autodetect) |
|
Back to top |
|
|
|