Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just got a new remote root-access server with 2 1TB disks in a Raid 1 configuration, running Debian (squeeze). Before installing my stuff on it, I'd like to switch to Raid 10 if I can. All the instructions I can find, for example Best way to grow Linux software RAID 1 to RAID 10, are for going from a 2-disk Raid 1 to a four disk Raid 10. Anyone have experience of making the move I have in mind, i.e. w/o any extra disks?

share|improve this question
1  
AFAIK, RAID 10 requires a minimum of four drives. Two drives can be a RAID 0 (stripe) or a RAID 1 (mirror) , but not a RAID 10 as RAID 10 is a striped mirror. –  joeqwerty Sep 24 '13 at 23:15
1  
To add: RAID 10 is really RAID 1+0. You take two drives, make a RAID 1, take another two drives, make that a RAID 1, then create a new RAID 0 with these two RAID 1s. Now you have RAID 10. Many RAID controllers take care of all of this for you, but that's what it should be doing. –  yoonix Sep 24 '13 at 23:21
    
@joeqwerty, this is not true, when using the Linux RAID10. the Linux RAID10 lets you do weird things, see: en.wikipedia.org/wiki/RAID#Non-standard_levels –  Zoredache Sep 25 '13 at 0:00
2  
@HST, while you can have a 2 disk 'RAID10' under Linux, but why do you think you would want to? What are you trying to accomplish? I highly doubt you are going to be able to do a re-shape from a RAID1 to some of the more obscure layouts. –  Zoredache Sep 25 '13 at 0:03
    
@Zoredache - Not being a Linux guy, I had no idea. Thanks for the clarification. –  joeqwerty Sep 25 '13 at 0:04
show 3 more comments

2 Answers 2

Normally you need a minimum of four disks for a RAID 10 array.

share|improve this answer
1  
This is not true with Linux software RAID10. Linux software RAID10 is not a 'true' RAID 10. Instead it is permits the user to arbitrarily define the number of copies, and the striping method, in addition to many other settings. See: en.wikipedia.org/wiki/RAID#Non-standard_levels –  Zoredache Sep 24 '13 at 23:59
2  
Just prepend your answer with "Normally, you need..." :) –  Stefan Lasiewski Sep 25 '13 at 2:18
    
@Zoredache Yes, but why would you want to? No gain in space from additional disks, and no performance gain since the same 2 drives and controller(s) are handling all the I/O. –  fukawi2 Sep 25 '13 at 3:15
    
@fukawi2, with the MD-RAID10 and two drives it acts somewhat like a RAID1, but you can offset the copies between the two drives. So one of the copies of a block would live at the start of one drive, and the other copy would be in the middle. Under some specific, and atypical, workloads, this will result in better performance. I had a bookmark to an article with lots of benchmarks, but it appears to have disappeared from the net. –  Zoredache Sep 25 '13 at 5:48
    
Wikipedia's Non-standard RAID levels article illustrates several 2-drive RAID-10 layouts, and claims performance gains for the 'far' layout "This offers striping performance on a mirrored set of only 2 drives." –  HST Sep 25 '13 at 9:01
show 2 more comments

The easy/safe way (rather than trying to do it in place):

  • Use fsarchiver to take copies of the filesystem(s) that will be migrated between the old array and the new array
    • Have a second backup copy of the data regardless
  • Unmount filesystems, stop and destroy the old array
  • Create the new array; see this question about raid10, f2 for some details
    • e.g. mdadm --create /dev/md0 -n2 -l10 -pf2 /dev/sda1 /dev/sdb1
  • Restore the filesystem(s) using fsarchiver
  • Check mount points and if this was your root drive, re-install the bootloader
share|improve this answer
    
Sounds simple, indeed, but, where do you stand to do step 3 "create the new array"? I'm running remotely, I can't boot and run 'in' e.g. a USB-self-contained distro. –  HST Sep 25 '13 at 14:48
    
@HST If you want to do this to the root of a live system, you're looking at a reshape, and based on what other comments are saying I'm not sure you're looking at the right answer to your problem. –  Andrew Sep 26 '13 at 3:53
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.