RAID
• Storage-centric computing, cloud computing.
• Benefits:
– Improved
reliability
(
via error correcting code, redundancy
).
RAID Level 0
• Independent disks.
• Provides a striping configuration at
the level of
blocks (
block striped
)
.
• No redundancy (
such as mirroring or parity bits
).
• Requests to different disks can be
handled in parallel.
• Single large request can be handled
in parallel (
improved performance but not reliability
).
- Bit-level striping - Byte-level striping
RAID Level 1
• Independent disks.
• Redundancy (
mirroring
).
• Read can be from either disk.
• Write to both disks (
can be done
in parallel
).
• Improved reliability (
but not
necessarily performance
).
RAID Level 2
• Synchronized spindles (
r/w heads in same pos.
).
• Parity bits for error-correcting code.
– P1 = x3 ⊕ x5 ⊕ x7 (
parity=0 when # of 1 bits is even
)
– P2 = x3 ⊕ x6 ⊕ x7 (
parity=1 when # of 1 bits is odd
)
– P4 = x5 ⊕ x6 ⊕ x7
• Can correct 1-bit error
– C1 = P1 ⊕ x3 ⊕ x5 ⊕ x7
if C1 = 1, there must be an error in one of the 4 bits:
1, 3, 5, and 7, which can be determined using a table.
P1 P2 X3 P4 X5 X6 X7
- When a bit in data disks is damaged, the computed parity does not match the stored parity. - When a stored parity bit is damaged, then it does not match the computed parity.
1-bit error correction
• C1 = P1 ⊕ x3 ⊕ x5 ⊕ x7
• C2 = P2 ⊕ x3 ⊕ x6 ⊕ x7
• C4 = P4 ⊕ x5 ⊕ x6 ⊕ x7
C4 | 0 0 0 0 1 1 1 1
C2 | 0 0 1 1 0 0 1 1
C1 | 0 1 0 1 0 1 0 1
---
| -- 1 2 3 4 5 6 7
When C1C2C4 = 000, there is no disk errors. Otherwise, there is some disk error.
Example:
If X3X5X6X7 = 1010, then P1P2P4 = 101, hence C1C2C4 = 000. If we have the following:
C1C2C4 = 110, then according to the table, it indicates that X3 is the disk that has the error (X3 appears in both C1 and C2).
P1 e rro r P2 e rro r P4 e rro r X3 i n e rro r X5 i n e rro r X6 i n e rro r X7 i n e rro r
If one of the disks fails, the remaining disks can be used to reconstruct the damaged data.
RAID Level 3 (
bit-interleaved parity
)
• Single parity disk is needed (
P4
).
•
P4
is defined as follows:
–
P4(i)
= x3(i)
⊕
x2(i)
⊕
x1(i)
⊕
x0(i)
• If x1 fails, then recovery can be carried out
–
x1(i) = 0: if P4(i) = x3(i) ⊕ x2(i) ⊕ x0(i)
–
x1(i) = 1: if P4(i) ≠ x3(i) ⊕ x2(i) ⊕ x0(i)
• Reduced mode:
– Read: missing data regenerated on the fly.
– Write: update parity disk (
P4
) for later
RAID Level 3 (
contd.
)
• Since disk controllers can detect if a sector has been
read correctly, so a
single parity bit
can be used for
error
correction and detection
.
• RAID 3 is as good as RAID 2, but only with one parity
disk overhead (
RAID 2 is not used in practice
).
• Advantages over RAID 1:
– Less overhead.
– Transfer rate for R/W a single block is faster.
• Disadvantages over RAID 1:
–
Fewer I/Os per second
since
every disk
has to participate in
every I/O request.
–
Expense of computing and writing the parity
.
- One parity disk is needed
RAID Level 4 (
block-interleaved parity
)
• Independent member disks
• Block level striping, and a parity block on
parity disk for all N blocks on data disks.
RAID Level 4 (
contd.
)
• Implication of a write request
–
P4 (i)
= x3(i) ⊕ x2(i) ⊕ x1 (i) ⊕ x0(i)
=
x3(i)
⊕
x2(i)
⊕
x1 (i)
⊕
x0(i)
⊕
x1(i)
⊕
x1(i)
=
P4(i)
⊕
x1(i)
⊕
x1 (i)
two reads (P4(i), x1(i)) and two writes (
P4 (i), x1 (i)
).
RAID Level 5
• Independent member disks.
• Organized similarly as RAID 4.
• Parity strips are across all disks
(
parity for n
thdisk is stored in disk (n+1) mod 5
)
RAID Level 6
• Similar to RAID 5.
• Differences:
– 2 bits of redundant data for every 4 bits of
data
– Can tolerate 2 disks failures.
P + Q redundancy scheme using
Nested RAID: RAID 0+1
• RAID 0+1: disks are
striped first
, and then
a stripe is mirrored to an equivalent stripe
(
two stripes
).
D5 D6 D2 D4 D3 D7 D8 D1 RAID 0 + 1 2 striping sets: {D1,D3,D5,D7}, {D2,D4,D6,D8} Bottom-line: if 2 drives fail in different stripe sets, the entire system is down (both stripes down).stripe set
Nested RAID: RAID 1+0
• RAID 1+0: disks are
mirrored in pairs first
,
and then the resulting mirrored pairs are
striped (
one stripe
).
D5 D6 D2 D4 D3 D7 D8 D1 RAID 1 + 0 4 mirror sets: {D1,D2}, …, {D7,D8}
Bottom-line: at most 4 drives can fail without affecting operation, so long as they are in diff. mirror sets.
stripe set
mirror set