RAID 101 - Introduction to RAID - RAID 3 - Striping with Dedicated Parity

Article Index
RAID 101 - Introduction to RAID
RAID 0 - Striping
RAID 1 - Mirroring
RAID 3 - Striping with Dedicated Parity
RAID 5 - Striping with Distributed Parity
Wrap-Up
All Pages

RAID 3 - Striping with Dedicated Parity

RAID 3, or Striping with Dedicated Parity, requires at least 2 disks for data and one more for the parity information, for a total of 3. Many controllers permit a RAID 3 set to be as many as 16 disks - 15 for data and 1 for parity, although in practice a system designer will limit the number of the disks to 3, 5 or 9. This is because the risk of a disk failure increases when you have more disks.

RAID 3 blends the redundancy of RAID 1 with the performance of RAID 0. RAID 3 starts off with a RAID 0 set, as described previously, and adds one more disk that stores a calculated form of the original data blocks, called parity.

The choice of 3, 5 or 9 disks is no coincidence - since the stripe size will be a number of Kilobytes (210 bytes), the number of data disks is chosen to divide the stripe evenly, and 1 more is added for the parity information. For some RAID controllers, this can provide a big performance increase.

The RAID 3 set is created using the same amount of space on each disk, and the total size is the same as the size used on each disk, times the number of data disks (N-1 disks). If we had a 250GB disk, a 320GB disk and a 500GB disk, the RAID 3 set would use 250GB on each disk, and the total size for the virtual disk would also be 500GB.

RAID 3 offers data protection but without the cost of RAID 1 - at most, RAID 3 is 50% more expensive than RAID 0, but that drops to 11% for a 9 disk set. Furthermore, when reading data, the disk controller reads from all of the disks, which is faster than a single disk, but is limited when writing by the parity disk, which is about the same as writing to a single disk.

Here’s our example data - a simple pattern of 3 ones followed by 3 zeroes for simplicity:

111000111000111000111000

Let’s store that data on our RAID 3 set. Just like RAID 0, we split the data into stripes:

11100011

10001110

00111000

Disk 1 and Disk 2 are our data disks, and Disk P is our parity disk. First we write the data to the data disks, half on each, and then we calculate parity and write it to the third disk: The parity disk is shown in green and the data disks in blue.

In this example, each digit of P is calculated by counting the number of "1" digits in the same place on the data disks. If the number of "1" digits is odd, then we store another 1 on the parity disk to show this. If the number of "1" digits is even, then we store a 0 instead. For the first stripe:

Block 1
Block 2
Block 3
Block 4
Data Disk 1
1
1
1
0
Data Disk 2
0
0
1
1
Parity Disk P
1
1
0
1

Then we write that stripe to the first stripe on the disks, and repeat for the other two stripes of data:

Disk 1
Disk 2
Disk P
RAID 3 Disk 1
RAID 3 Disk 2
RAID 3 Disk P

In practice the disk controller uses an operation called "XOR" for "Exclusive OR", which is a faster way of gathering the same data and calculating the parity – but the result is identical to the example above.

Let’s see what happens if the parity disk fails. Take away Disk P and we have:

Disk 1
Disk 2
Disk P
RAID 3 Disk 1
RAID 3 Disk 2
RAID 3 Disk P

Our original data is still there on the data disks: "111000111000111000".

Now let's see what happens if we lose a data disk instead:

Disk 1
Disk 2
Disk P
RAID 3 Disk 1
RAID 3 Disk 2
RAID 3 Disk P

When we try to read our data, we get the first half back, "1110". Then the controller takes that data, compares it to the parity, and applies the same algorithm as before:

Block 1
Block 2
Block 3
Block 4
Data Disk 1
1
1
1
0
Parity Disk P 1
1
0
1
Data Disk 2
0
0
1
1

We've recovered our lost data by calculating it from the remaining disks.

So we see that in a RAID 3 set, if any one of the disks fails, the data is safe.

Where Does RAID 3 Make Sense

RAID 3 is a fairly rare RAID type, primarily because the performance of the RAID set during writes is low thanks to the single parity disk. As a result it is usually overlooked for its close cousin, RAID 5.

Still, RAID 3 is perfect for large read-only data sets, or where the amounts of data written are small or insignificant and reliability is crucial. Implementations of RAID 3 are usually special-purpose systems, often databases and data warehouses.

Let's move on and take a look at RAID 5, Striping with Distributed Parity.



Comments (4)
  • doublemint  - homebuilt NAS owner
    I'd also like to know what the recovery process is like, especially if the RAID controller fails. Can a failed RAID controller be replaced with one of a different brand and still recover? As a novice, the RAID BIOS is a bit confusing, some pointers would be helpful. I had a motherboard with RAID fail and assumed I could take one of my RAID 1 drives, plug it into another PC and read it however I couldn’t, why?
  • zaphod  - reply
    Im pretty sure youd need both HDs for that to work... not just one.
  • David Rawling  - Your Mileage Will Vary
    Basically, the answer is no - you need the same model of RAID controller to replace a failed one.

    This applies from the virtually-free Intel RAID controllers on the motherboard to the thousand (and multiple-thousand) dollar add-in cards.

    Each controller has its own way of marking the disks as being part of a RAID set - the disk "signature". One brand might write "RAID1-1" to the first disk and "RAID1-2" to the second. Others might use numbers with the brand (MYRAID-716825).

    I guess it comes back to the same comment I made before. RAID is not backup. It only protects you from disk failure.
  • doublemint  - homebuilt NAS owner
    David,

    While unfortunate there isn't more standardization, I understand why this might be. I can't however understand why this would apply to RAID 1 (mirroring). Why do these drives need to be treated any different than non-RAID drives? Just write the same data two places rather than just one.
Comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
Banner