20 - Storage Systems & Disk Management
603 words
3 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# 20 - Storage Systems & Disk Management ## 🎯 Learning Objectives After reading this topic, you will be able to: - Describe the storage hierarchy (cache → RAM → disk → tape) - Calculate disk access time (seek + rotational + transfer) - Compute MTTF for disk systems - Understand the role of buffer management ## 📖 C...

20 - Storage Systems & Disk Management
🎯 Learning Objectives
After reading this topic, you will be able to:
- Describe the storage hierarchy (cache → RAM → disk → tape)
- Calculate disk access time (seek + rotational + transfer)
- Compute MTTF for disk systems
- Understand the role of buffer management
📖 Core Content
20.1 Storage Hierarchy
(Diagram)
| Level | Speed | Size | Volatile? |
|---|---|---|---|
| Cache | 1 ns | KB | Yes |
| RAM | 10-100 ns | GB | Yes |
| SSD | 0.1 ms | GB-TB | No |
| HDD | 5-10 ms | TB | No |
| Tape | Seconds | TB-PB | No |
20.2 Magnetic Disk Structure
A hard disk consists of:
- Platters: Circular disks coated with magnetic material
- Tracks: Concentric circles on each platter
- Sectors: Divisions of tracks (typically 512 bytes)
- Cylinders: Same track across all platters
- Read/write head: Moves across the platter to access data
20.3 Disk Access Time
Taccess=Tseek+Trotation+Ttransfer| Component | Description | Formula |
|---|---|---|
| Seek time ( Tseek ) | Time to move arm to correct track | Tseek=avg seek time |
| Rotational latency ( Trotation ) | Time for platter to rotate to correct sector | Trotation=21×RPM60 |
| Transfer time ( Ttransfer ) | Time to read/write data | Ttransfer=transfer ratedata size |
Transfer rate = rotation timesectors per track×sector size
Worked Example
Problem: Seek time = 3ms, rotational speed = 30000 RPM, 200 sectors/track, sector size = 512 bytes. File size = 1000KB.
- Transfer rate = 200×512÷(60/30000)=102400÷0.002=51.2 MB/s
- Rotational latency = 21×3000060=1 ms
- Access time per sector = 3 + 1 = 4 ms If file is contiguous: Transfer time = 1000KB / 50 KB/ms = 20ms. Total = ~20ms. If file is scattered: Need 2000 sectors (1000KB / 512 bytes). Total = 2000 × 4ms + 20ms = 8.02 seconds!
20.4 MTTF (Mean Time To Failure)
- MTTF for a single disk: Average time until the disk fails
- MTTF for a system of n disks: nMTTFdisk (assuming independent failures)
Worked Example
30 disks tested for 24 hours. 15 failed after 18 hours, 8 failed after 22 hours, 7 survived entire 24 hours.
Total operating hours = 15×18+8×22+7×24=270+176+168=614 hours Number of failures = 23 MTTF for one disk = 614/23=26.7 hours MTTF for 15 disks = 26.7/15=1.78 hours
📐 Key Formulas
| Formula | Description |
|---|---|
| Taccess=Tseek+Trotation+Ttransfer | Total disk access time |
| Trotation=2×RPM60 | Average rotational latency |
| MTTFsystem=nMTTFdisk | System MTTF for n disks |
⚠️ Common Pitfall
The Mistake: Calculating rotational latency as full rotation time instead of half.
Why: Average rotational latency is half the rotation time (2×RPM60), not the full rotation (RPM60).
📝 Practice Questions
Q1. A disk has 30000 RPM, seek time 5ms, 400 sectors/track, sector size 512B. Find the transfer rate.
AnswerData per track = 400 × 512 = 204800 bytes Rotation time = 60/30000 = 0.002s = 2ms Transfer rate = 204800 / 0.002 = 102.4 MB/s
Q2. What is the storage hierarchy? Why is it important for DBMS?
AnswerCache → RAM → SSD → HDD → Tape. Each level is larger, slower, and cheaper. DBMS uses this hierarchy strategically: frequently used data stays in memory (cache/RAM), bulk data on disk, archives on tape.
🔗 Cross-References
- Next Topic: 21 - RAID Systems
- Related: BSCS4022 (OS) — Storage management
- Textbook: Chapter 10 (Storage and File Structure) Join Discord Previous19 - Application DesignNext21 - RAID Systems