ONTAP Discussions

Is RAID-4 on 2 disks a RAID-1 in fact?

krzysztof_karpeta
12,031 Views

I have a questin to DataONTAP experts.

I can create a RAID-4 configuration on 2 disks (aggr create -t raid4 -r 2).

How do you think, is it RAID-1 in fact?

PS.

I know, the difference between RAID-1 (mirror level) and RAID-4 (parity level), but I don't know how RAID-4 works on 2 disks.

Thank you.

15 REPLIES 15

ewerner
11,957 Views

Krzysztof,

I wouldn't consider myself an expert on OnTAP, but I think I can still answer your question.

RAID 4 on 2 disks is still RAID 4, where information is stored on one disk (the data disk) and parity is stored on the other disk (the parity disk).  In RAID 1, the information is mirrored from one disk to the other (as you said in your PS), so even with two disks a RAID 4 array is different because it is providing fault tollerence rather than 1-1 information duplication.  In the event of a data disk failure, the array would switch to degraded mode and begin reading and writing information based on the PARITY information in the parity disk (i.e. caclulating missing information) rather than just switching pointers in the event of a RAID 1/mirror set failure.

I see your arguement on why it might seem like RAID 1 in this scenario, but the way the information is laid down on the disks is still different, so it is still considered RAID 4 with 2 disks.  Furthermore, in a RAID 1 set, you are committed to a 1-1 disk ratio, but if you wanted to expand the RAID 4 array all you would need to do is add disks to the aggregate.

I hope this answers your question, and if I have left anything out, I would appreciate it if anyone with a better explanation could step in and set me straight.

Thanks!

Ethan Werner

Technical Systems Engineer

nkenneth
11,959 Views

Sounds like a great explanation Ethan.

Just wanted to mention that there are trade-offs if you are planning on making a 2 disk raid instead of going with the default size.  It may fit your need just fine, but I thought it better to point it to be safe.  

Most importantly make sure to understand the –r switch and the difference between raidsize (maximum number of disks in the raid group) versus ndisks (number of drives to add in the aggr).

This link may be useful;

http://now.netapp.com/NOW/knowledge/docs/ontap/rel7311/html/ontap/smg/provisioning/concept/c_oc_prov_raid-groups-size.html#c_oc_prov_raid-groups-size

krzysztof_karpeta
11,957 Views

Thanx for reply Ethan,

But what's, with performance?

How do you think, is it similar in both configurations?

In my opinion RAID-1 is faster in read (reads from 2 disk independly vs. reads from data disk only) and write (no overhead for parity calculating) then RAID-4 on 2 disks.

I'm interesting in it, because someone told me, that RAID-4 on 2 disks is functional equivalent RAID-1.

Regards

ewerner
11,959 Views

That I'm not 100% sure about, but from my understanding the RAID 4 would be comparable in speed, or possibly a tiny bit slower due to the parity calculations... but keep in mind that the way RAID 1 works, it lays the information down to the disk, then mirrors it over, it's not a similtaneous write--also, when you're doing reads, in a RAID 1 scenario, the active disk is used, but not the mirror.  The mirror disk is used for redundancy only, not reads or writes, so you'll still get single disk speeds.

As far as RAID 4 and RAID 1 being functionally equivalent, I suppose you could say that, as long as you understand that the way they're writing the information is different in each different scenario, and that recovering from a failure is completely different.

Again, if anyone else would like to add to this, please feel free.

Thanks!

krzysztof_karpeta
9,431 Views

Ethan,

As supplement to your email.

Only some low-end RAID-1 implementation use "active-passive" configuration.

Most RAID-1 implementation use independent disk acces with "active-active" configuration.

So read performance RAID-1 is nearly twice as single disk.

Thanx

Krzysztof

ewerner
9,431 Views

I was unaware of that, Krzysztof.  I guess my understanding of RAID 1 could use a bit of freshening up.

Thanks for the additional info!

Ethan Werner

Technical Systems Engineer

eric_barlier
11,957 Views

Hi Mr Karpeta,

Its a common misunderstanding from some, NetApp competition in particular, to state that raid-dp (netapps implementation of raid6) is slower due to having to

compute extra parity. the fact is that all of this is done in the NVRAM card BEFORE going to disk, thus this is not holding up performance given that the NVRAM

is much faster than most disks IE.

http://media.netapp.com/documents/tr-3298.pdf

regards,

Eric

scottgelb
11,958 Views

There are some legacy edge cases we saw where 2 drive raid4 raid groups were been used when disk utilization was over 50% on an aggregate before losing a disk and losing a drive would cause degradation.  If there is a disk failure, disk I/O will increase (estimating double if remaining disks are read an extra I/O for missing data) on remaining disks until the rebuild is complete..so if 50%+ utilization before a failure, raid4 will have degradation to the aggregate until the rebuild is done.  Depending on aggregate size, adding disks to keep utilization down works but if you max the aggr size and still are over 50% and can't have degradation...there is the edge case.  This is independent of the rebuild for performance.  With 2 drive raid groups, there isn't the issue of doubling I/O on remaining drives and I/O performance is stable even with the failure.  Since syncmirror is free now, it probably makes more sense...raid_dp+1.  A disadvantage of RAID4 2 drive raid groups compared to syncmirror on raid_dp aggregates is that background disk firmware updates will not occur since they work with dual parity...unless you manually get around it by adding a dual parity drive, wait for rebuild, wait for background fw update to complete, then drop the dual parity drive and zero it...painful and not too functional.

Unless there have been changes in WAFL that are new, ONTAP stripes to disk from RAM when NVRAM is half full or every 10 seconds (whichever occurs first).  Parity is kept in memory with data prior to write and block maps are used to determine write stripes.  NVRAM isn't used to write to disk but is used as insurance until RAM is flushed to disk.

krzysztof_karpeta
11,958 Views

Hi Scott,

Your answer was very helpful, but I've another question.

Does data fill raid groups in aggregate concurrently or sequentially.

Regards

scottgelb
11,957 Views

Great question...someone on the WAFL team maybe can clarify (correct me).... From the block map, all disks are written to in the aggregate across all raid groups concurrently.  I remember something about 4k blocks grouped into chunks of 24 per drive...96k total per disk across all raid groups concurrently... When you look at the disk drives you see them all blink together on write so it is concurrent...although if a near full aggregate there are other considerations and incomplete stripes to fill.

This white paper is great for an overview.. http://www.netapp.com/us/library/technical-reports/wp-3001.html

Sebastian_Goetze
11,958 Views

Hi,

in addition to the previous answers my 2cents:

The parity in RAID-4 (and RAID-DP) is calculated as a sum across the blocks in the stripe, an XOR, to be exact.

In the case of a 2 disk RAID-4 group, the parity would therefore be the exact contents of the data drive.

In other words, if you wouldn't know better, it sure would look like RAID-1.

But it's an edge case... The internal workings are different, it's expandable and the recovery is different.

Like Scott mentioned, the data is written concurrently to all available disks (in the way he mentioned, chains and all...).

In the edge case of a 2-disk aggregate, though, if would obviously be faily sequential.

One thing to keep in mind, if you're playing with the idea of building an aggregate out of 2-disk RAID-4 RGs:

RAID-DP gives you about 1000-times (depending on disk type and raid group size...) better security, more performance and uses just a bit over half as many disks!

(Less disks - less risk, ANY 2 disks can fail in a RAID-DP aggr, whereas in the 2-disk RG aggregate, if a pair fails, you've got data loss)

Hope that helped

Sebastian

krzysztof_karpeta
9,431 Views

Sebastian,

"The parity in RAID-4 (and RAID-DP) is calculated as a sum across the blocks in the stripe, an XOR, to be exact.

In the case of a 2 disk RAID-4 group, the parity would therefore be the exact contents of the data drive."

Probably you've right, but ...

1. RAID-4 is a parity raid

2. XOR function is a 2 elements function

So, If we have only 1 disk for data, we have to calculate XOR using 0  (neutral element for xor) or 1 (inverse element for xor) as a second element.

If we use 0, you've right, but if use 1 you haven't.

I know that it's stupid, but RAID-4 on 2 disks is stupid too.

Krzysztof

Sebastian_Goetze
9,431 Views

Hi Krzysztof,

according to tr-3298, page 5, the XOR being used for parity is comparable to summing up the contents.

I assume therefore, that the XOR used in calculating parity is the usual n-element function, e.g. XOR(1,2,3,...,16).

It wouldn't make sense IMHO to treat the edge-case of 1+P different than the other possible configurations (e.g. 4+P in above tr-3298).

That's why I'm pretty sure, the parity is a copy of the 1 drive instead of a 'negative'.

Anyway I agree, that it's stupid to build aggregates out of 2-disk RAID 4 raid groups.

I wonder why so many others do it...  (=RAID 10...)  

Sebastian

krzysztof_karpeta
9,431 Views

Sebastian,

XOR isn't n-element function, it's a two-element Boolean algebra function.

Notation XOR(e1,e2,...,en) realy means e1 xor e2 xor ... xor en.

Krzysztof

Sebastian_Goetze
9,431 Views

Yep, I shortened the notation a bit.

From Wikpedia:

Exclusive disjunction is often used for bitwise operations. Examples:

  • 1 xor 1 = 0
  • 1 xor 0 = 1
  • 1110 xor 1001 = 0111 (this is equivalent to addition without carry)

As noted above, since exclusive disjunction is identical to addition modulo 2, the bitwise exclusive disjunction of two n-bit strings is identical to the standard vector of addition in the vector space (\Z/2\Z)^n.

In computer science, exclusive disjunction has several uses:

  • It tells whether two bits are unequal.
  • It is an optional bit-flipper (the deciding input chooses whether to invert the data input).
  • It tells whether there is an odd number of 1 bits (A \oplus B \oplus C \oplus D \oplus E is true iff an odd number of the variables are true).

In logical circuits, a simple adder can be made with an XOR gate to add the numbers, and a series of AND, OR and NOT gates to create the carry output.

On some computer architectures, it is more efficient to store a zero in a register by xor-ing the register with itself (bits xor-ed with themselves are always zero) instead of loading and storing the value zero.

In simple threshold activated neural networks, modeling the ‘xor’ function requires a second layer because ‘xor’ is not a linearly-separable function.

Exclusive-or is sometimes used as a simple mixing function in cryptography, for example, with one-time pad or Feistel network systems.

XOR is used in RAID 3–6 for creating parity information. For example, RAID can “back up” bytes 10011100 and 01101100 from two (or more) hard drives by XORing (11110000) and writing to another drive. Under this method, if any one of the three hard drives are lost, the lost byte can be re-created by XORing bytes from the remaining drives. If the drive containing 01101100 is lost, 10011100 and 11110000 can be XORed to recover the lost byte.

This explanation agrees with my (educated) guess...

Public