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
- Buffer: temporary storage between mismatched speeds. Cache: a copy of data kept for reuse.
- Spooling: queue output for a device that can serve only one job at a time.
- RAID 0: striping, fast, no redundancy. RAID 1: mirroring.
- 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 level | Layout | Usable capacity (n disks) | Survives |
|---|---|---|---|
| 0 | striping, no redundancy | n | no failure |
| 1 | mirroring | n / 2 | one disk per mirror pair |
| 5 | striping with distributed parity | n − 1 | one disk |
| 6 | striping with double parity | n − 2 | two disks |
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
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.