← 💿 Disk Scheduling & I/O
Subtopic 4 of 4

8.4Buffering, spooling, device drivers and RAID

The idea

Buffering, caching and spooling smooth device speed differences; RAID combines disks for speed and safety.

Think of it like this: A water tank between a pump and a tap (buffer); a pile of print jobs waiting for a single printer (spool).

Why it exists

Devices differ in speed and sharing, and single disks fail.

How it works

  1. Buffer: temporary storage between mismatched speeds. Cache: a copy of data kept for reuse.
  2. Spooling: queue output for a device that can serve only one job at a time.
  3. RAID 0: striping, fast, no redundancy. RAID 1: mirroring.
  4. RAID 5: striping with distributed parity, survives one failure, capacity n − 1.

Worked example: 6 disks of 500 GB in RAID 5

Usable capacity = (6 − 1) × 500 = 2500 GB. RAID 1 would give 1500 GB and RAID 0 3000 GB.

Now play with it

  • →Change the number of disks and compare the capacities.
  • →Which levels survive a disk failure?
RAID levelLayoutUsable capacity (n disks)Survives
0striping, no redundancynno failure
1mirroringn / 2one disk per mirror pair
5striping with distributed parityn − 1one disk
6striping with double parityn − 2two disks
RAID 0 capacity (GB)3000
RAID 1 capacity (GB)1500
RAID 5 capacity (GB)2500
RAID 6 capacity (GB)2000

Buffering, caching and spooling are separate ideas: buffering smooths speed, caching keeps copies, spooling queues output for a one-job-at-a-time device.

Check yourself

RAID 5 with n disks has a usable capacity of

Remember: Buffer smooths, cache reuses, spool queues. RAID 5: n − 1 usable, survives one failure.
Exam notes (the dense version)

Buffering smooths speed differences; caching keeps a copy of data; spooling queues output for a device that serves one job at a time (printer). The kernel I/O subsystem hides devices behind device drivers. RAID: 0 stripes (speed, no redundancy), 1 mirrors (half the capacity), 5 stripes with distributed parity (survives one disk failure, capacity (n − 1) disks). Usable capacity: RAID 0 = n, RAID 1 = n/2, RAID 5 = n − 1 disks.

Previous year questions: Disk Scheduling & I/O (12)

PYQs are grouped by topic, so this is the full set for Disk Scheduling & I/O; try the ones that match this subtopic. Open all 12 on the topic page.