How does RAID 5 work? The Shortest and Easiest explanation ever!

AID: 6510
  • Status: Published

1900 points

  • ByOpen-E
  • TypeGeneral
  • Posted on2011-06-29 at 04:26:31
We all have limited time to study long and complicated information about RAID theories, but you may be interested as to how RAID 5 works. We made it simple for you by providing the shortest and easiest explanation ever.  

First we need to remind you XOR definition:

XOR function result is equal 1 if both arguments are different.

XOR (0, 1) = 1
XOR (1, 0) = 1

XOR function output is equal 0 if both arguments are same.

XOR (0, 0) = 0
XOR (1, 1) = 0

Now let us assume we have 3 drives with the following bits:

| 101 | 010 | 011 |

And we calculate XOR of those data and place it on 4th drive

XOR (101, 010, 011) = 100     (XOR (101,010) = 111 and then XOR (111, 011) = 100

So the data on the four drives looks like this below:

| 101 | 010 | 011 | 100 |

Now let’s see how the XOR MAGIC works. Let’s assume the second drive has failed. When we calculate XOR all the remaining data will be present from the missing drive.

| 101 | (010) | 011 | 100 |

XOR (101, 011, 100) = 010

You can check the missing other drives and XOR of the remaining data will always give you exactly the data of your missing drive.

| 101 | 010 | (011) | 100 |

XOR (101, 010, 100) = 011

What works for 3 bits and 4 drives only, works for any number of bits and any number of drives. Real RAID 5 has the most common stripe size of 64k (65536 * 8 = 524288 bits). So the real XOR engine only needs to deal with 524288 bits and not 3 bits as in our exercise. This is why the RAID 5 needs a very efficient XOR engine in order to calculate it fast. So when adding one drive for parity you will be able to rebuild the missing data in case of any drive failure.

In our example we have explained RAID 4 where parity is on a dedicated drive. RAID 5 will distribute parities evenly between all drives. Distributed parity provides a slight increase in performance but the XOR magic is the same.

To learn more about RAID 5 please go to Wikipedia article.
Asked On
2011-06-29 at 04:26:31ID6510
Tags

RAID 5

Topic

Hard Drives & Storage

Views
1109

Comments

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Storage Misc Experts

  1. hanccocka

    247,063

    Guru

    0 points yesterday

    Profile
    Rank: Genius
  2. andyalder

    186,674

    Guru

    2,000 points yesterday

    Profile
    Rank: Genius
  3. dlethe

    151,091

    Guru

    0 points yesterday

    Profile
    Rank: Genius
  4. Callandor

    76,887

    Master

    0 points yesterday

    Profile
    Rank: Genius
  5. paulsolov

    72,153

    Master

    0 points yesterday

    Profile
    Rank: Genius
  6. meyersd

    50,146

    Master

    0 points yesterday

    Profile
    Rank: Genius
  7. kevinhsieh

    42,168

    2,800 points yesterday

    Profile
    Rank: Genius
  8. woolmilkporc

    41,212

    0 points yesterday

    Profile
    Rank: Genius
  9. rindi

    33,652

    0 points yesterday

    Profile
    Rank: Savant
  10. shahzoor

    33,509

    0 points yesterday

    Profile
    Rank: Guru
  11. nobus

    33,393

    0 points yesterday

    Profile
    Rank: Savant
  12. noxcho

    33,214

    0 points yesterday

    Profile
    Rank: Genius
  13. BigSchmuh

    28,987

    0 points yesterday

    Profile
    Rank: Sage
  14. garycase

    27,968

    0 points yesterday

    Profile
    Rank: Genius
  15. arnold

    26,694

    0 points yesterday

    Profile
    Rank: Genius
  16. SelfGovern

    22,967

    0 points yesterday

    Profile
    Rank: Wizard
  17. Shbasha

    18,208

    0 points yesterday

    Profile
    Rank: Master
  18. charlestasse

    18,144

    0 points yesterday

    Profile
    Rank: Wizard
  19. pgm554

    18,126

    0 points yesterday

    Profile
    Rank: Sage
  20. robocat

    16,490

    0 points yesterday

    Profile
    Rank: Sage
  21. ve3ofa

    16,400

    0 points yesterday

    Profile
    Rank: Genius
  22. DavisMcCarn

    15,300

    0 points yesterday

    Profile
    Rank: Genius
  23. strung

    13,800

    0 points yesterday

    Profile
    Rank: Genius
  24. chakko

    12,725

    0 points yesterday

    Profile
    Rank: Genius
  25. millardjk

    12,424

    0 points yesterday

    Profile
    Rank: Master

Hall Of Fame