Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Can someone explain the physical architecture of RAID 10 in complete layman's terms?

I'm trying to figure out how exactly works the RAID 10 in linux with mdadm.

I want to create a RAID 10 out of 4 partitions, let's say a, b, c and d. a and b are on the array 1, c and d array 2.

So what I want is to have the couple a and b, c and d in RAID 0. Then on top of that, a RAID 1.

The option in the mdadm command to configure the layout is -p, --layout with option : near, far, offset see here

I want to keep my data safe if the array 1 fails for example, that would mean that every chunk of data are always copied on both arrays.

How do I have to set my RAID 10, near or far ?

EDIT: 1 more information very important: In fact, I have 2 * DriveDUO 320GB that are each of them, detected as 2 * 160GB. So a and b are "linked" together and if one fails, the other fails because they are on the same card/PCI-E.

share|improve this question

marked as duplicate by Chris S, John Gardeniers, Scott Pack, Tom O'Connor, Mark Henderson Jan 14 '11 at 3:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Can you be more specific about what you mean by two partitions on each array? Why would have you have two partitions on a single array in a RAID10? – Zoredache Jan 12 '11 at 22:29
Sounds like a strange idea to set up raid on top of partitions rather than disks. RAID is a "Redundant Array of Independent Disks", not partitions. – micmcg Jan 12 '11 at 23:10
"I want to keep my data safe if the array 1 fails for example" - You've got it completely backwards. The reason to use RAID is to protect against disk failure. Perhaps you should take a few moments to read up about RAID and the underlying principles and reasons for using it before proceeding. – John Gardeniers Jan 12 '11 at 23:47
@micmcg, RAID10 is a nested RAID level. @Bastien974, in RAID10 you first mirror disks (RAID 1), then stripe them (RAID 0). – Mircea Chirea Jan 13 '11 at 7:34
I'm gonna explain myself because I understand that it's a non sense to use partition. In fact, I have 2 FusionIO DriveDUO 320GB ( ). Each of them are detected as 2 * 160GB. If 1 DriveDUO fails, I lost the 2 drives: a and b or c and d. – Bastien974 Jan 13 '11 at 13:20


"So what I want is to have the couple a and b, c and d in RAID 0. Then on top of that, a RAID 1."

I would advise you otherwise.

Make a RAID 1 set of a and b, and c and d and then do RAID 0 on top of that. This will provide you better risk management. This will let you keep a RAID 0 even if one drive from both the set fails. You want RAID 1+0 and not RAID 0+1

share|improve this answer
+1 for noting that the RAID levels were backwards. – ewindisch Jan 13 '11 at 4:42

Setting your RAID-10 to near or far with Linux MD does not have any significant result on the reliability of the RAID. Instead, it is a performance optimization depending on if you have (sequential) read-heavy or write-heavy access.

If you have more sequential reads than writes, then you should choose 'far'.

If you have more writes than sequential reads, choose 'near'.

If you want something that should be optimal for both, and if you're using a large enough block size, choose 'offset'.

This is explained in md(4)

share|improve this answer
As others noted, you need separate disks for each RAID volume member. Each physical disk can safely belong to multiple RAID volumes, but no disk should exist more than once in a single RAID volume. – ewindisch Jan 13 '11 at 0:34
You have it backwards. The far layout is for sequential-read heavy tasks. The near layout is the default, and is more appropriate for workloads with more writes. – RibaldEddie Jan 13 '11 at 5:22
@RibaldEddie thanks, you're right. – ewindisch Jan 13 '11 at 6:13
But in my case, because a and b are linked, the RAID need to be set so a and b can be lost together --> far, am I correct ? – Bastien974 Jan 13 '11 at 13:37

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