chapter 37 - Hard Disk Drives Flashcards
(18 cards)
What is the basic interface of a disk drive?
A disk is an array of sectors, numbered 0 to n−1
What assumptions do we make about disk performance?
Nearby blocks are faster to access, and sequential access is faster than random access
Describe the physical structure of a hard disk
Platters spin around a spindle. Each surface has concentric tracks, and read/write heads on a disk arm move to access data
What is rotational delay?
waiting for the desired sector to rotate under the head
Average = R/2 of a full rotation time
What is seek time?
Time it took to move the disk arm to the correct track
what is the seeks different phases
- accelerate → the disk arm gets moving
- coast → as the arm is moving at full speed
- decelerate → as the arm slows down
- settle → as the head is carefully positioned over the correct track
what is track skew
timing adjustment between the starting sectors on a hard drive
What’s the difference between write-through and write-back caching?
Write-through: writes to cache and immediately written to main memory as well
write-back: first to cache and later to memory
What is the formula for total I/O time?
T(I/O) = T(seek) + T(rotation) + T(transfer)
What is the I/O rate formula?
R(I/O) = Size(transfer) / T(I/O)
Compare random vs sequential workloads
Random: small, scattered reads (e.g., databases)
Sequential: large, contiguous data (e.g., streaming)
What does the SSTF ( Shortest Seek Time First) disk scheduler do?
Chooses the request on the closest track to the current head position
eks (om du ikke skjønte): current position of the head is over the inner track, and we have requests for sectors 21 (middle track) and 2 (outer track) → we would then issue the request to 21 first, wait for it to complete, and then issue the request to 2
What is Nearest-Block-First (NBF)?
A software approximation of SSTF using block address distance, not physical track distance
Describe SCAN (Elevator algorithm)
The head moves in one direction, servicing requests, then reverses direction
How does C-SCAN differ from SCAN?
C-SCAN only services in one direction, then jumps back to the start, improving fairness
F - SCAN
Freezes the request queue during a sweep; late arrivals go to a future sweep
What is SPTF (Shortest Positioning Time First)?
Chooses based on seek + rotational delay
eks (for mer info): Request A needs a short seek but long rotation; request B needs longer seek but is just about to pass under the head → SPTF would choose B
Why is SPTF hard to implement in the OS?
The OS doesn’t know the disk head’s rotational position