You are not logged in.

#1 2009-06-14 09:00:48

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Converting a 2-disk RAID-1 to a 3-disk RAID-5 safely

Hi,

I have a software RAID-1 with 2x 1.5GB drives. I want to convert this to RAID-5 and add a third drive. According to this article (http://scott.wallace.sh/?s=raid) I can just change the meta data and mdadm should rebuild it into a RAID-5 array. Now, I would like to do it just a little bit safer, so my idea is to just remove one of the current hard drives and put that one aside as backup. Now my question is, can I convert the RAID-1 to RAID-5 with only one drive inside? This would make the actual command look like this:

 # mdadm --create /dev/md0 --level=5 -n 2 /dev/sda1 missing

After that I would add the newly bought empty drive and let the array rebuild. If that turns out alright, I would the add the third drive (which is the one I put aside as backup). Last steps then would be to grow the array and resize the ext3 filesystem.

If all this is possible, I have just one more question. When I add the last drive, does mdadm care that it already contains all the exact same data as the first drive? Or does mdadm know that because it's the last drive added, it should just wipe it clean and write whatever it wants on it?

Last edited by HyperBaton (2009-06-14 09:01:54)

Offline

#2 2009-06-14 10:22:10

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Converting a 2-disk RAID-1 to a 3-disk RAID-5 safely

Sounds like a sound theory.

And to answer your last question, it should wipe the drive. The actual layout of the data on the drive is completely different, so it can't reuse the existing data. It might complain if there's already data there, but I don't know. If it does, just 'dd' the first few mb of the drive with zeros and it should damage the data enough to make it unrecognisable to mdadm.

Offline

#3 2009-06-14 10:35:59

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: Converting a 2-disk RAID-1 to a 3-disk RAID-5 safely

Okay, thanks. I guess what I was really asking is if the data layout of the disk that is used to grow the array, can somehow compromise the data already on the RAID. But judging from your answer, I suppose not. Which makes sense, because that would defy the whole point of adding a new disk to the array.

Offline

#4 2009-06-14 11:22:00

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: Converting a 2-disk RAID-1 to a 3-disk RAID-5 safely

One last question... When I add the third drive and I start growing the RAID, is my data fully protected? Suppose 1 out of the 3 drives fails during the growing, will my data be corrupted?

Last edited by HyperBaton (2009-06-14 11:22:19)

Offline

#5 2009-06-14 11:32:08

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Converting a 2-disk RAID-1 to a 3-disk RAID-5 safely

Isn't that quite obvious? How different would that be from resizing a partition, from a safety point of view?

Back up your data if you want peace of mind.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2009-06-14 11:40:40

HyperBaton
Member
From: Belgium
Registered: 2008-01-18
Posts: 207

Re: Converting a 2-disk RAID-1 to a 3-disk RAID-5 safely

Maybe the shop will lend me a second disk for a day or two wink

Offline

Board footer

Powered by FluxBB