CSS Prepare

optional · CSS study notes

RAID

CSS Optional — Paper-II, Section-A · Chapter 7 · 🔥 Frequently repeated numerical topic

RAID combines several physical disks into a single logical drive to achieve performance, redundancy, or both. The design premise is that disks are individually unreliable, so reliability must be engineered at the array level rather than the disk level.

Terminology note: RAID originally stood for "Redundant Array of Inexpensive Disks" (Patterson, Gibson & Katz, Berkeley, 1988). Industry later rebranded it "Redundant Array of Independent Disks." Either expansion is accepted in the exam.

🗺️ Architecture Diagram — RAID Layouts

graph TD
    subgraph RAID0["RAID 0 - Striping"]
        D0A["Disk1: A1"]
        D0B["Disk2: A2"]
    end
    subgraph RAID1["RAID 1 - Mirroring"]
        D1A["Disk1: A"]
        D1B["Disk2: A copy"]
    end
    subgraph RAID5["RAID 5 - Striping + Distributed Parity"]
        D5A["Disk1: A1"]
        D5B["Disk2: A2"]
        D5C["Disk3: Parity of A1,A2"]
    end

1. The Three Underlying Techniques

Every RAID level is built from some combination of these:

  • Striping — data is split into blocks written across multiple disks in parallel. Increases throughput because several disks read/write simultaneously. Provides no redundancy on its own.
  • Mirroring — an identical copy of all data is kept on a second disk. Maximum redundancy, but only 50% of raw capacity is usable.
  • Parity — an error-correction block computed with XOR across the data blocks. If one disk fails, its contents are reconstructed by XOR-ing the surviving disks with the parity. Far cheaper than mirroring: it costs the capacity of one disk regardless of array size.

How parity works (worth one line in an answer):

Parity P = D1 ⊕ D2 ⊕ D3
If D2 fails, recover it:  D2 = D1 ⊕ P ⊕ D3

2. RAID Levels

RAID 0 — Striping

  • Data striped across all disks; no redundancy whatsoever.
  • ✅ Best read and write performance; 100% capacity usable.
  • ❌ Zero fault tolerance. One disk failure destroys the entire array. Reliability is actually worse than a single disk, since failure of any member is fatal.
  • Minimum disks: 2. Use: video editing scratch space, caches — never for data you need to keep.

RAID 1 — Mirroring

  • Every block written identically to two disks.
  • ✅ Excellent redundancy; fast reads (either disk can serve a request); simplest recovery.
  • ❌ Only 50% capacity efficiency; write performance no better than a single disk.
  • Minimum disks: 2. Use: OS drives, small critical databases.

RAID 5 — Striping with Distributed Parity ⭐

  • Data and parity blocks striped across all disks; parity is distributed rather than sitting on one dedicated disk (which would become a write bottleneck, the flaw of the obsolete RAID 4).
  • ✅ Tolerates one disk failure; good read speed; efficient capacity use.
  • ❌ Write penalty — each write requires reading the old data and old parity, computing new parity, then writing both: four operations per logical write. Rebuild after failure is slow and stresses the remaining disks.
  • Minimum disks: 3. Use: file and application servers — historically the most common level.

RAID 6 — Double Distributed Parity

  • Two independent parity blocks per stripe.
  • ✅ Tolerates two simultaneous failures — important for large arrays where a second disk may fail during the long rebuild after the first.
  • ❌ Higher write penalty than RAID 5; more capacity overhead.
  • Minimum disks: 4. Use: large archival arrays with high-capacity drives.

RAID 10 (1+0) — Mirrored Pairs, Then Striped

  • Disks are mirrored in pairs, and those pairs are striped.
  • ✅ Excellent read and write performance; fast rebuilds (just copy from the surviving mirror); tolerates multiple failures provided they are not both halves of the same pair.
  • ❌ Only 50% capacity efficiency — the most expensive common level.
  • Minimum disks: 4. Use: high-transaction OLTP databases.

3. Comparison Table (high-yield)

LevelTechniqueMin disksUsable capacityFault toleranceReadWrite
RAID 0Striping2N × S (100%)❌ NoneExcellentExcellent
RAID 1Mirroring2S (50%)1 diskGoodModerate
RAID 5Stripe + parity3(N−1) × S1 diskGoodModerate (penalty)
RAID 6Stripe + 2 parity4(N−2) × S2 disksGoodSlower
RAID 10Mirror + stripe4(N/2) × S (50%)1 per mirror pairExcellentGood

(N = number of disks, S = capacity of one disk)

4. Capacity Formulas

RAID 0  : Usable = N × S
RAID 1  : Usable = S                    (2-disk mirror)
RAID 5  : Usable = (N − 1) × S
RAID 6  : Usable = (N − 2) × S
RAID 10 : Usable = (N / 2) × S

Capacity efficiency = Usable capacity / Raw capacity × 100%

🧮 Solved Numerical 1 — RAID 5 Usable Capacity

Q: Five 1 TB disks are configured in RAID 5. Find the usable capacity and capacity efficiency.

Usable = (N − 1) × S
       = (5 − 1) × 1 TB
       = 4 TB

Raw capacity = 5 × 1 TB = 5 TB

Efficiency = 4/5 × 100% = 80%

Answer: 4 TB usable, 80% efficiency. The equivalent of one disk's capacity is consumed by parity — but note the parity is distributed across all five disks, not stored on one.

🧮 Solved Numerical 2 — Comparing All Levels on the Same Hardware

Q: Given eight 2 TB disks, compute usable capacity under RAID 0, 1, 5, 6, and 10.

Raw capacity = 8 × 2 TB = 16 TB

RAID 0  : 8 × 2 TB           = 16 TB  (100% efficiency, 0 fault tolerance)
RAID 1  : (8/2) × 2 TB       =  8 TB  (50%,  mirrored sets)
RAID 5  : (8 − 1) × 2 TB     = 14 TB  (87.5%, tolerates 1 failure)
RAID 6  : (8 − 2) × 2 TB     = 12 TB  (75%,  tolerates 2 failures)
RAID 10 : (8/2) × 2 TB       =  8 TB  (50%,  tolerates 1 per pair)

Answer as above. This tabulated comparison is exactly what examiners want when a question says "compare RAID levels for a given configuration" — it demonstrates the cost-of-redundancy trade-off in one view.

🧮 Solved Numerical 3 — Parity Reconstruction

Q: A RAID 5 array holds data blocks D1 = 1011, D2 = 0110, D3 = 1100. Compute the parity block, then show how D2 is recovered if its disk fails.

Compute parity (XOR across data blocks):

D1     = 1011
D2     = 0110
       ────── XOR
         1101
D3     = 1100
       ────── XOR
P      = 0001

Recover D2 after failure (XOR the survivors with parity):

D1     = 1011
D3     = 1100
       ────── XOR
         0111
P      = 0001
       ────── XOR
D2     = 0110   ✓ matches the original

Answer: Parity P = 0001; D2 recovered as 0110. Showing this XOR working proves you understand why one disk's worth of parity protects an array of any size — a strong answer point.

🧮 Solved Numerical 4 — Determining Disks Needed

Q: An organisation needs 12 TB of usable, single-fault-tolerant storage using 3 TB disks in RAID 5. How many disks are required?

RAID 5: Usable = (N − 1) × S

        12 = (N − 1) × 3
     N − 1 = 4
         N = 5 disks

Answer: 5 disks (15 TB raw, 12 TB usable, 3 TB consumed by parity).

🧮 Solved Numerical 5 — RAID 5 Write Penalty

Q: A RAID 5 array performs 4 physical disk operations per logical write. If the array's raw capability is 1,000 disk operations per second, how many logical writes per second can it sustain?

Logical writes/sec = Raw operations/sec ÷ Write penalty
                   = 1,000 / 4
                   = 250 logical writes/sec

Answer: 250 writes/sec. The array delivers only a quarter of its raw operation capability for writes — this write penalty is the main reason write-heavy databases use RAID 10 instead of RAID 5.


🎯 CSS Exam Angle

RAID appears in two reliable forms: a capacity numerical (levels 0/1/5 most often) and a compare-and-justify question ("which RAID level would you recommend for a banking database and why?").

For the justification variant, always answer along three axes: capacity efficiency, fault tolerance, and write performance. A banking OLTP system → RAID 10 (write speed + redundancy outweigh cost). An archival file server → RAID 6 (capacity efficiency + tolerance of a second failure during rebuild).

For full marks: write the capacity formula, substitute, state the answer with units, and add the efficiency percentage — the last step is frequently omitted and easily earns the difference.

🔁 Repeated CSS Questions

  1. Explain RAID levels 0, 1, and 5 with their performance and redundancy trade-offs. (Frequently repeated)
  2. Calculate usable storage capacity for a given RAID 5 configuration. (Numerical — frequently repeated)
  3. Differentiate between RAID 1 and RAID 5 in terms of cost, capacity, and fault tolerance.
  4. What is striping, mirroring, and parity? How does each contribute to RAID design?
  5. Which RAID level would you recommend for a high-transaction database, and why? (Applied)
  6. How is a failed disk's data reconstructed in RAID 5? (Parity/XOR)

⚠️ MCQ Traps

  • RAID 0 provides NO fault tolerance. Despite the "R" for redundant in the acronym, RAID 0 is purely a performance configuration and is less reliable than a single disk. This is the most-tested fact on the topic.
  • RAID 5 tolerates exactly ONE disk failure, RAID 6 tolerates two. Candidates often credit RAID 5 with more.
  • RAID 5 parity is distributed across all disks, not stored on a single dedicated parity disk — that is RAID 4, which is obsolete precisely because the dedicated parity disk became a bottleneck.
  • RAID is not a backup. It protects against hardware failure, not against accidental deletion, corruption, or ransomware, since those propagate to the mirror or parity immediately.
  • RAID 10 ≠ RAID 01. RAID 10 mirrors first then stripes (more robust); RAID 01 stripes first then mirrors (less robust). RAID 10 is preferred.
  • Minimum disk counts: RAID 0 → 2, RAID 1 → 2, RAID 5 → 3, RAID 6 → 4, RAID 10 → 4.

📜 Past-Paper Questions & MCQs (CSS 2016–2026)

2016 · Paper-II · Q3(a) · 8 marks

Q. RAID presents several physical disk drives to the operating system as a single logical drive, with data distributed across the drives. Explain the different levels of RAID with suitable diagrams.

Ans.

  • RAID 0 (striping): data is split into blocks spread across the disks. It is fast, with no redundancy, so one disk failure loses everything. D1: A1 A3 | D2: A2 A4
  • RAID 1 (mirroring): every block is written to two disks. It is reliable and reads are fast, but it needs 100% extra capacity. D1: A1 A2 | D2: A1 A2
  • RAID 2: bit-level striping with Hamming-code error correction on extra disks (rarely used).
  • RAID 3: byte or bit-level striping with one dedicated parity disk and synchronised disks. It is good for large sequential transfers.
  • RAID 4: block-level striping with a dedicated parity disk. The parity disk becomes a bottleneck for writes.
  • RAID 5: block-level striping with parity distributed over all disks. It survives one disk failure and is the most common choice. D1: A1 B1 Cp | D2: A2 Bp C1 | D3: Ap B2 C2
  • RAID 6: like RAID 5 with two parity blocks, so it survives two disk failures.
  • Choice: 0 for speed, 1 for safety, 5 for a balance of capacity and protection.

2023 · Paper-II · Q2(c) · 6 marks

Q. In the context of RAID, what is the distinction between parallel access and independent access?

Ans.

  • Parallel access (RAID 2 and 3): all disks take part in every I/O request, with synchronised spindles. A single large transfer is spread over all disks, which gives high data-transfer rates for big sequential reads and writes, but only one request is handled at a time.
  • Independent access (RAID 4, 5, 6): disks can service different operations separately, so multiple small requests may proceed concurrently when they concern different disks. This supports transaction-oriented workloads; parity updates may still coordinate several drives.
BasisParallel-access RAIDIndependent-access RAID
Disk operationDrives cooperate in a synchronized I/ODrives can work on separate requests
Typical levelsRAID 2/3RAID 4/5/6
Strongest workloadLarge streaming transfersMultiple smaller simultaneous I/O requests
Main limitationLimited independent-request concurrencyParity-write overhead and contention

Example: RAID 3 distributes one large file transfer across synchronized disks; RAID 5 may serve several unrelated reads from different disks concurrently. Conclusion: Parallel access emphasizes bandwidth for one request, whereas independent access emphasizes I/O concurrency. This comparison and example are appropriate for six marks.