Operating systems

Hard Disk Drives

Prashanth L.A.

2023-11-07

Lecture 39

Hard disk drives

Crux 6: How to store and access data on disk?

How do modern hard-disk drives store data? What is the interface? How is the data actually laid out and accessed? How does disk scheduling improve performance?

A Disk With Just A Single Track

Platter

Spindle

Track

Disk head

To read/write

operation description
seek. move arm to correct track
rotate. wait for correct block to come by
transfer do read/write of the sector

\[T_{I/O} = T_{seek} + T_{rotate} + T_{transfer}\]

\(T_{seek} + T_{rotate}\): Aim to minimize

I/O example

\(T_{seek} = 10ms\), Rate of transfer \(= 100MB/s\)

Sequential I/O Random I/O
Size 10MB 10KB
\(T_{I/O}\) \(10ms+ \frac{10MB}{100MB/s} = 110ms\) \(10ms+ \frac{10kB}{100MB/s} \sim 10ms\)
Rate of I/O \(\frac{10MB}{110ms} = 90.9MB/s\) \(\sim 1MB/s\)

Disk Scheduling

The scheduling problem

Alternative 1: SSTF (Shortest Seek Time First)

Crux 7: How to handle disk starvation

How can we implement SSTF-like scheduling but avoid starvation?

Elevator

Variants

Incorporating rotational delay

I/O merging