Skip to content

Commit

Permalink
Add images illustrating RAID levels
Browse files Browse the repository at this point in the history
  • Loading branch information
bertvv committed Nov 23, 2024
1 parent 9dcc8ca commit 5b33e77
Show file tree
Hide file tree
Showing 7 changed files with 362 additions and 0 deletions.
352 changes: 352 additions & 0 deletions images/storage_raid/raid-diagrams.drawio

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions modules/storage_raid/030_raid_theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ Deciding on which *raid level* to choose depends on the requirements of the spec

**raid 0** uses two or more disks, and is often called *striping* (or *stripe set*, or *striped volume*). Data is divided in *chunks*, evenly spread across every disk in the array. The main advantage of *raid 0* is that the performance is higher than a single disk. *raid 0* is the only *raid* level without redundancy. When one disk fails, all data is lost.

![raid 0](assets/raid-0-striping.png)

### jbod

**jbod** (Just a Bunch Of Disks) uses two or more disks, and is often called *concatenating* (or *spanning*, *spanned set*, or *spanned volume*). Data is written to the first disk, until it is full. Then data is written to the second disk, etc. The main advantage of *jbod* is that you can create *larger drives* than the space available on a single disk. However, JBOD offers no redundancy and no performance gain.

![jbod](assets/raid-jbod.png)

### raid 1

**raid 1** uses exactly two disks, and is often called *mirroring* (or *mirror set*, or *mirrored volume*). All data written to the array is written on each disk. The main advantage of *raid 1* is *redundancy*. The main disadvantage is that you lose at least half of your available disk space (in other words, you at least double the cost).

![raid 1](assets/raid-1-mirroring.png)

### raid 2, 3 and 4?

**raid 2** uses bit level striping, *raid 3* byte level, and *raid 4* is the same as *raid 5* (see below), but with a dedicated parity disk (we'll explain parity in the next section). This is actually slower than *raid 5*, because every write would have to write parity to this one (bottleneck) disk. It is unlikely that you will ever see these *raid* levels in production.
Expand All @@ -28,6 +34,8 @@ time chunks are written to the array, one of the disks will receive a
alternate between all disks. The main advantage of this is that *raid 5*
will allow for full data recovery in case of *one* hard disk failure.

![raid 5](assets/raid-5-parity.png)

*Parity* is a method to reconstruct data when one disk fails. When data is written to one of the disks of the array, e.g. a byte with binary representation `0100 1110`, it is combined with the data on the same position on one of the other disks, e.g. `1010 1011`, using the logical XOR operation:

| A | B | A XOR B |
Expand Down Expand Up @@ -67,6 +75,8 @@ This also works for arrays with more than 3 disks. For example in an array with

*raid 1+0* (also called *raid 10*) is a stripe(0) of mirrors(1). For example, when you have six 100GB disks, then you first create three mirrors of 100GB each. You then stripe them together into a 300GB drive. In this example, as long as not all disks in the same mirror fail, it can survive up to three hard disk failures.

![raid 10](assets/raid-10.png)

### raid 50

*raid 5+0* is a stripe(0) of *raid 5* arrays. Suppose you have nine
Expand Down
Binary file added modules/storage_raid/assets/raid-0-striping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/storage_raid/assets/raid-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/storage_raid/assets/raid-5-parity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added modules/storage_raid/assets/raid-jbod.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5b33e77

Please sign in to comment.