Quiz 2

20 - Storage Systems & Disk Management

603 words
3 min read
Python Week 1: the first filter for runtime behavior
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)
LevelSpeedSizeVolatile?
Cache1 nsKBYes
RAM10-100 nsGBYes
SSD0.1 msGB-TBNo
HDD5-10 msTBNo
TapeSecondsTB-PBNo

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+TtransferT_{access} = T_{seek} + T_{rotation} + T_{transfer}
ComponentDescriptionFormula
Seek time ( TseekT_{seek} )Time to move arm to correct trackTseek=avg seek timeT_{seek} = \text{avg seek time}
Rotational latency ( TrotationT_{rotation} )Time for platter to rotate to correct sectorTrotation=12×60RPMT_{rotation} = \frac{1}{2} \times \frac{60}{RPM}
Transfer time ( TtransferT_{transfer} )Time to read/write dataTtransfer=data sizetransfer rateT_{transfer} = \frac{\text{data size}}{\text{transfer rate}}
Transfer rate = sectors per track×sector sizerotation time\frac{\text{sectors per track} \times \text{sector size}}{\text{rotation time}}

Worked Example

Problem: Seek time = 3ms, rotational speed = 30000 RPM, 200 sectors/track, sector size = 512 bytes. File size = 1000KB.
  1. Transfer rate = 200×512÷(60/30000)=102400÷0.002=51.2 MB/s200 \times 512 \div (60/30000) = 102400 \div 0.002 = 51.2 \text{ MB/s}
  2. Rotational latency = 12×6030000=1 ms\frac{1}{2} \times \frac{60}{30000} = 1 \text{ ms}
  3. 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: MTTFdiskn\frac{MTTF_{disk}}{n} (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=61415 \times 18 + 8 \times 22 + 7 \times 24 = 270 + 176 + 168 = 614 hours Number of failures = 23 MTTF for one disk = 614/23=26.7614 / 23 = 26.7 hours MTTF for 15 disks = 26.7/15=1.7826.7 / 15 = 1.78 hours

📐 Key Formulas

FormulaDescription
Taccess=Tseek+Trotation+TtransferT_{access} = T_{seek} + T_{rotation} + T_{transfer}Total disk access time
Trotation=602×RPMT_{rotation} = \frac{60}{2 \times RPM}Average rotational latency
MTTFsystem=MTTFdisknMTTF_{system} = \frac{MTTF_{disk}}{n}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 (602×RPM\frac{60}{2 \times RPM}), not the full rotation (60RPM\frac{60}{RPM}).

📝 Practice Questions

Q1. A disk has 30000 RPM, seek time 5ms, 400 sectors/track, sector size 512B. Find the transfer rate.

Answer
Data 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?

Answer
Cache → 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

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.