01223 828800

Ickleford manor, Turnpike Lane, Hitchin. SG5 3XD

Search
MJM data recovery

What are the different RAID levels

This is a question we often get asked by customers. In this article, we describe the different RAID levels.

RAID levels

There are many types of RAID levels, so this article will cover the fundamental set. JBOD, RAID0, RAID1, RAID5, RAID6. It will also cover RAID10, so you can understand how Hybrid RAIDs are built.

In order to view the tables, please flip your phone to landscape view.

An important point to note is that RAID is not an alternative to backing up data. A backup means that you have at least two separate copies of your data, so that if you lose access to your system, then you can rebuild your data. If, for example, a Server catches fire and the RAID data storage is destroyed, and there is no separate backup, you cannot rebuild your data. You will need a backup, including off-site or cloud backups of, at least, your critical data.

What is a JBOD or volume set

A JBOD (Just a Bunch Of Drives) consists of two or more drives that are configured such that a part of one drive is logically attached to the others in a structured manner. Technically, JBOD is not RAID as there is no redundancy.  Below is an example of how 3 × 1 TB drives in a JBOD may be linked together as a ‘spanned’ volume.

                    JBOD
Drive 0 R Data area 0 R
Drive 1 R Data area 1 R
Drive 2 R Data area 2 R


Note that the
‘R‘ at the beginning and end of each drive is reserved space and is not used for data storage. The first reserved area part will contain header information describing the JBOD. The second is because a JBOD has to be of a size that is divisible by the cluster size, there will nearly always be unused space at the end of each drive.

The data area of all three drives is added  together and presented as a single ~3 TB spanned volume to the operating system and can be given a single drive letter, and the entire space is available for storage.

Because of the unused space, when doing data recovery, the unused areas must be considered. If it is not, then data stored beyond the first data area will be corrupt. We have seen this many times in the past where other data recovery companies have not checked the unused areas.

There is a serious downside to JBOD, and that is because there is no redundancy. If any single drive fails, then the data stored in that drive is inaccessible.


Here is a different configuration where the JBOD starts at a different partition on the system. Let’s say 300 GB is reserved for the operating system.

                    JBOD
Drive 0 S Operating system R Data area 0 R
Drive 1 R Data area 1 R
Drive 2 R Data area 2 R

In this scenario, the volume starts just after the operating system, and flows into the other drives in the JBOD. The ‘S‘ is the system area reserved by the operating system and contains information about the OS partition, and the JBOD.

RAID 0 consists of a minimum of two drives. This is technically not a RAID, as like JBOD it offers no redundancy.

In a RAID 0 configuration, data is stored in numbered blocks. Each block consists of a group of sectors that is a multiple of 2. On a typical RAID volume, the blocks are 64k for each block. So, the first 64k (Block 0) is stored on the first drive, the next block on the second drive and so on. This repeats throughout the volume.

Drive 0 Block 0 Block 2 Block 4 Block 6 Block 8 Block 10
Drive 1 Block 1 Block 3 Block 5 Block 7 Block 9 Block 11

This is a basic two drive RAID 0 system. You can see how the data is stored on each drive. When it is presented to the operating system, it will show as a single volume, as shown below.

Virtual disk 0 1 2 3 4 5 6 7 8 9 10 11

Straight away, the problem with RAID 0 comes to light. If any one of the two drives fail, then access to all the data is lost.

The advantage, though, is speed. Data reads and writes are done simultaneously, meaning that data can be transferred at high speed.

Its primary use is for ‘scratch‘ purposes, such as video, and audio processing and other applications where a lot of TEMPORARY data is shifted around.

A Raid 1 system usually consists of two drives. The second drive is an identical copy of the first drive, this allows for redundancy so, if one drive fails then the system will continue to work with the remaining drive but in what is known as ‘degraded‘ mode.

Below is a diagram of a pair of Raid 1 drives. When Raid 1 failures happen, it is important to identify which drive failed first. Often they will run after a failure, so if the failure is not noticed or not acted on and one drive failed before the other, there will be a lag in the copies of the data.

When this is the case, we can identify the drive that failed before the other. We can also recover data with bad blocks on one or both drives,  by combining a single image from specific areas of any single drive with bad sectors with the good ones from the second drive.

Drive 0 Block 0 Block 1 Block 2 Block 3 Block 4 Block 5
Drive 1 Block 0 Block 1 Block 2 Block 3 Block 4 Block 5

The two drives are presented to the computer system as a single volume.

Virtual disk Block 0 Block 1 Block 2 Block 3 Block 4 Block 5

Notice that the device is called a ‘Virtual disk’ this is because more than one drive is included in the volume presented to the operating system. In windows disk manager, a hardware-based raid will appear as a single Physical disk. Where a software-based RAID will show as both physical drives pointing at a single volume, or drive letter.

RAID 1 is best suited for critical systems that must have zero or very little downtime. For example, an eCommerce – web server, if this were to fail then your business would start losing money the moment it failed. With RAID 1 in place the server would keep running after a single drive failure and a spare drive could be inserted and rebuilt automatically without any downtime.

The drawbacks of RAID 1 are that writes to the drives take longer, as for each change there are two write operations and two for verification. However, reading data speeds are similar to that of RAID 0 where a controller supports read ahead. This means that when data is read, the blocks are read as if it were a RAID 0.

 

 

RAID 5 arrays require a minimum configuration of three drives, with the data stored in stripes. In an array with 4 drives, each stripe contains 3 data blocks and a single parity block. In the majority of RAID 5 configurations, the parity block ‘rotates‘ to the next drive in the sequence. The diagrams slow that in stripe ‘0’ parity is on drive 3, on stripe ‘1’ the parity has ‘rotated‘ to drive 2. Hence, the term ‘Striping with rotating parity’

For our examples, we are using 4 drives with 64 kB blocks.

 

Standard RAID 5 layouts

Stripes Drive 0 Drive 1 Drive 2 Drive 3
Stripe 0 Block 0 Block 1 Block 2 Parity 0, 1, 2
Stripe 1 Block 4 Block 5 Parity 3, 4, 5 Block 3
Stripe 2 Block 8 Parity 6, 7, 8 Block 6 Block 7
Stripe 3 Parity 9, 10, 11 Block 9 Block 10 Block 11

This type of raid is known as  RAID 5 rotating  parity N with data continuation. The N means the first parity block is the last drive.

Below shows a RAID 5 Rotating Parity N without data restart. You can see Stripe 1: block 3 is at the start of the new row. Compare this position to the one above. This demonstrates the need for a complete understanding of how RAID functions when performing data recovery.

Stripes Drive 0 Drive 1 Drive 2 Drive 3
Stripe 0 Block 0 Block 1 Block 2 Parity 0, 1, 2
Stripe 1 Block 3 Block 4 Parity 3, 4, 5 Block 5
Stripe 2 Block 6 Parity 6, 7, 8 Block 7 Block 8
Stripe 3 Parity 9, 10, 11 Block 9 Block 10 Block 11

You can see the importance of getting the drive rotation in the correct order.

There are 12 variations of RAID 5, the second most common is RAID 5 Rotating Parity 0. In these arrays, the parity starts on drive 0 and rotates forward.

There are also RAID5E, RAID5EE and RAID5EEE, all of which use hot space in one form or another.

 

What is delayed parity?

Below is a Delayed parity RAID configuration, mainly used by  HP RAID server systems. But also used on large SAN based storage servers.

This parity type is named by the SNIA as RAID-5R Rotating Parity N after R Stripes with Data Restart and, of course, there is the RAID-5R Rotating Parity 0 after R Stripes with Data Restart version too for forward parity systems.

Usually, there are at least 2 consecutive parity blocks. For HP The parity block is typically 2 MB, we have also seen 4 MB on some HP SAN systems. So, for a standard HP raid the data blocks are 64k, so we divide 2,097,152 by 65536 giving 32 blocks of parity.

For the example below, we have reduced it to 2, so you can get the gist of how it works without have to scan over pages of tables.

Our data blocks remain at 64 kB, and the parity block is 128 kB.

Stripes Drive 0 Drive 1 Drive 2 Drive 3
Stripe 0 Block 0 Block 1 Block 2 Parity 0, 1, 2
Stripe 1 Block 3 Block 4 Block 5 Parity 3, 4, 5
Stripe 2 Block 6 Block 7 Parity 6, 7, 8 Block 8
Stripe 3 Block 9 Block 10 Parity 9, 10, 11 Block 11
Stripe 4 Block 12 Parity 12, 13, 14 Block 13 Block 14
Stripe 5 Block 15 Parity 15, 16, 17 Block 16 Block 17
Stripe 6 Parity 18, 19, 20 Block 18 Block 19 Block 20
Stripe 7 Parity 21, 22, 23 Block 21 Block 22 Block 23

RAID 5 can be used for all types of data storage. Because of the parity block in each stripe, it offers the security of redundancy. If a single drive fails, the data is still accessible from the remaining drives in the array. Where hot spares are used, the system will automatically rebuild on detection of a drive failure. However, If a second drive fails, then the system will halt.

What is parity?

Parity is a logic function where each byte in a block is XOR’ed with the block on the next drive. This continues for each data block in the stripe, with the final result stored in the parity block.

As a simple example, if you take 3 decimal numbers.

25, 36, 75

We calculate p = (25 XOR 36 XOR 75) = 118

If we put these 4 values in a table, and we have a missing value for 2, we can calculate the missing value using XOR.

#1 #2 #3 p

Values 25 Missing 75 Parity = 118

We can now calculate the missing value m.

m = (25 XOR 75 XOR 118  = 36 The missing value!

So, our RAID 5 will still work with one drive missing, as the data is recalculated in memory.

The system will slow down considerably when a failure happens, so monitor the system carefully. Two failures will result with the server shutting down. If the server is in a separate room or building, a failure may go unnoticed.

RAID 6 requires a minimum of 4 drives, for each stripe, two drives are dedicated to redundancy.

The first uses standard XOR algorithms as described in RAID 5 above.

The second, or q parity is calculated differently. Parity q uses a much more complex algorithm using Reed Solomon Galois Fields, (marked as RS in the table below). Considering that two drives can fail, it has to be calculated so that the missing drives can be rebuilt with the data from the remaining good drives.

If you have a RAID 5 array of 6 or more drives, it is worth considering switching to RAID 6 for the extra protection it offers.

 

Here is an example of a RAID 6 Rotating Parity N with Data Continuation.

‘N’ means that the parity and RS blocks are on the last two drives of the array.

Stripes Drive 0 Drive 1 Drive 2 Drive 3 Drive 4 Drive 5 Drive 6 Drive 7
Stripe 0 Block 0 Block 1 Block 2 Block 3 Block 4 Block 5 Parity RS
Stripe 1 Block 6 Block 7 Block 8 Block 9 Block 10 Parity RS Block 11
Stripe 2 Block 12 Block 13 Block 14 Block 15 Parity RS Block 16 Block 17
Stripe 3 Block 18 Block 19 Block 20 Parity RS Block 21 Block 22 Block 23
Stripe 4 Block 24 Block 25 Parity RS Block 26 Block 27 Block 28 Block 29
Stripe 5 Block 30 Parity RS Block 31 Block 32 Block 33 Block 34 Block 35
Stripe 6 Parity RS Block 31 Block 32 Block 33 Block 34 Block 35 Block 36
Stripe 7 RS Block 37 Block 38 Block 39 Block 40 Block 41 Block 42 Parity

There are other RAID 6 variations, such as the above but with data restart, and Rotating Parity 0 where the parity block is on drive 0 and rotates forwards, again with data restart, or continuous.

RAID 6 systems can be used for all data types, and are preferred when there are more than 8 drives are in an array. Especially with 8, 10 TB and larger sized drives available today.

Edit Template

 Hybrid RAID consists of a multiple of primary RAID type, i.e. RAID 1 and then combined into a secondary RAID, i.e. RAID0

When viewing Hybrid RAID notation, the first number is the primary RAID, and the second number is the secondary RAID. For example, RAID10, describes the primary RAID level as RAID1, and the secondary RAID level is RAID0.

There must be more than one Primary RAID to create a secondary RAID. So, again, for RAID 10 we would have 2× RAID1 Arrays, combined into a single RAID 0.

Another example could be RAID51. Two RAID5 volumes, configured as a mirrored pair.

What is RAID 10

RAID 10 consists of two or more mirrored pairs. In the example below, we are using two RAID 1 arrays named, R1 Volume 0 and R1 Volume 2. Each volume contains two drives, giving a total of 4 drives for the configuration.

At creation, the mirrored volumes are divided into blocks that run consecutively on the same volume. A RAID0 needs at least 2 volumes and is broken down into blocks of, typically 64 kB, as per the RAID 0 item above.

To show these we will use the format V=Volume, B=Block to show the division of the data, e.g. V0:B0, V1:B0, etc.

To accomplish this, we need to split the data on the RAID1 into blocks to comply with RAID0.

The block size for the RAID0 element is set by the RAID adapter, but on some adapters it can be set manually.

Volumes Drives
R1 Volume 0 V0:B0 V0:B1 V0:B2 V0:B3
R1 Volume 1 V1:B0 V1:B1 V1:B2 V1:B3
Final result
R0 Volume V0:B0 V1:B1 V0:B2 V1:B3

What is RAID 01

RAID 01 is where we have two primary RAID 0 arrays. The second RAID 0 is a mirror of the first one. Again, this needs at least 4 drives, 2 for each RAID 0.

Both RAID 10 and RAID 01 are quite an expensive method of RAID, as you need 4 drives to configure the system. It does offer redundancy of a max of 2 failures. There are two drives in a mirrored pair, so a single failure will result with the system still running. However, if there are two failures on the same mirror pair, the system will fail.

In my opinion, when there are only 4 drives available, it is a much better option to go for RAID6 as it offers dual redundancy, and you have the same amount of storage.

With RAID6 it does not matter which 2 drives fail as the system will still run. As previously mentioned, our RAID10 will fail if there are two failures on the same mirror. So if you are using a NAS box or some other 4-drive server with RAID10, check to see if it supports RAID6.

Edit Template
Scroll to Top