Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How would I grow a RAID10 array using mdadm?

Obviously I would need to add 2 drives at a time, or would it have to be 4 drives?

I have a feeling its just a bad idea.

Or would be just wiser to just opt for RAID5?

share|improve this question
    
Usually, if someone is asking me if they need RAID 10, that means they don't need it. Why not Raid 5 or Raid 6? –  surfasb Jul 17 '11 at 14:57
    
I was hoping for better write performance than RAID5.. But I guess the lack of flexibility rules that out.. –  stuartc Jul 17 '11 at 20:49
    
In general, RAID 5/6 will provide better write performance than RAID 10/01. Because you are distributing writes across all drives versus only half the drives. –  surfasb Jul 17 '11 at 21:15
2  
@surfasb "RAID 5/6 will provide better write performance than RAID 10" no it won't, because distributing the writes over more drives is more that out-weighed by the write penalty of RAID5/6 –  Jack Douglas Mar 1 at 21:22
    
@JackDouglas: Very good information. –  surfasb Mar 3 at 17:13
add comment

5 Answers 5

up vote 4 down vote accepted

Last time I checked, mdadm won't let you --grow raid10. I glanced over mdadm's manpage now and it still says: Currently supported growth options including changing the active size of component devices and changing the number of active devices in RAID levels 1/4/5/6, changing the RAID level between 1, 5, and 6, changing the chunk size and layout for RAID5 and RAID5, as well as adding or removing a write-intent bitmap.

share|improve this answer
    
Thanks! Appreciated, also another good hint this isn't going to happen quickly either is that I can't find one hardware RAID card that does it either.. RAID5 it is.. –  stuartc Jul 17 '11 at 20:42
2  
RAID5 can be painfully slow on some workloads. What do you intend to do? –  Stingray Jul 19 '11 at 17:12
    
Mostly just storing media, but also mounting an NFS share for photo editing, so was hoping for some good write speeds as well as reads. –  stuartc Jul 20 '11 at 14:15
add comment

I realize this is over a year old but someone might find this helpful...

You can expand a raid 10 array, but not how you are hoping. You would have to nest multiple levels of raid. This can be done with mdadm on 2 drives in raid 10, which quite nice performance depending on the layout, but you would have to make multiple 2 disk raid 10 arrays, then attach them to logical node. Then to expand add a few more, and stripe across that. If that is your use case (needing to expand a lot) then you would be wise to use a parity array, which can be grown.

These are the limitations you get with raid 10, while maintaining better read/write performance overall. And a clarification, raid 5/6 absolutely does not "In general, provide better write performance...". Raid 5/6 has their own respective pros/cons just as raid 10, but write performance is not a pro for raid 5/6.

Also, you didnt specify the size of your drives but beware of raid 5 on new large drives. Though if you are careful, you can recover from an unrecoverable read error, you risk downtime and the possibility of not being able to recover at all.

--edit to add info-- Use tools like hdparm (hdparm -i) and lshw to get the serial numbers along with the device name (/dev/sda) when you have a failure. This will ensure you remove the correct device when replacing. Up-arrow on Travis' comment as it is very correct and a nice layout, but as usual, weight the pros and cons of every solution.

share|improve this answer
add comment

I know it's more work and could get confusing, but you can always stripe multiple mirrors.

For example I just setup a 4 drive raid 10 array and latter want to add another 4 drive raid 10 array. Just use mdadm to create a new raid 10 array on the new drives. You could then either create another raid 0 array using the two existing raid devices. However I would use the features of lvm to create the stripe, thus keeping mdadm configs and /dev/md devices in an easy to understand state. Either method would work, and there are probably more but that's what I could do off the top of my head.

share|improve this answer
    
Great way of managing a growing dataset, much easier than most. Tricky part is keeping track of which drives have failed in which which mirror set. But yeah great suggestion! –  stuartc Oct 18 '12 at 17:16
add comment

You cannot grow a RAID10-array, this is true. But you can start with two drives (at the cost of no redundancy at this point) and then later, add two more. I have used this method to switch from a RAID5 array with four disc drives to RAID10 with four disc drives.

I degraded RAID5 and removed one disc out of the array. This gave me two discs that were free to use. Then I created a RAID10-array with something along the lines of 'mdadm --create --level 10 /dev/md0 /dev/sda1 missing /dev/sdc1 missing'. This was enough to start the array.

When I had moved the data from the degraded RAID5-array to the RAID10-array, I added two of the RAID5-discs to the RAID10-array and added the extra one as a spare.

It is probably a good idea if someone who is more knowledgable than I can talk about any performance impact this may have had. But the primary reason for my post is to show that it is possible to start off with RAID10 and two drives.

Note: do read the following forum post that asks and answers whether the disk order in mdadm matters.

share|improve this answer
add comment

Some great news from the release announcement for mdadm 3.3:

This is a major new release so don't be too surprised if there are a few issues...

Some highlights are:

...

  • RAID10 arrays can be reshaped to change the number of devices, change the chunk size, or change the layout between 'near' and 'offset'. This will always change data_offset, and will fail if there is no room for data_offset to be moved.

...

According to this answer on U&L, you will need at least linux 3.5 as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.