0

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.

Bastien974
  • 1,824
  • 12
  • 43
  • 61
  • 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
  • 1
    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 07: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 ( http://www.fusionio.com/products/iodriveduo/ ). 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

2 Answers2

3

FYI

"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

Sameer
  • 4,070
  • 2
  • 16
  • 11
2

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)

ewindisch
  • 286
  • 1
  • 4
  • 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 00: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 05:22
  • 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