Complete infographic study notes on file allocation methods, directory models, seek times, and disk arm scheduling.
File Allocation Methods
The OS decides where to write files on disk sectors using three core allocation strategies:
Method
How It Works
Pros
Cons
Contiguous
File occupies a set of consecutive sectors/blocks on disk.
Best read performance (sequential access is fast).
External fragmentation, difficult for files to grow.
Linked
File is a linked list of disk blocks scattered anywhere. Block holds sector data + pointer to next block.
No external fragmentation, file can grow dynamically.
Slow random access, pointer storage overhead, fragile (broken link corrupts file).
Indexed
Pointers to all scattered file blocks are brought together into a single "Index Block".
Supports efficient random access, no external fragmentation.
Overhead of index blocks (wasted space for tiny files).
Disk Arm Mechanics & Access Time
Disk Latency Elements
The total time to read or write data to a magnetic spinning platter disk includes:
Seek Time: The time taken for the disk arm to move the read-write heads to the correct cylinder/track. (This is the largest bottleneck, taking several milliseconds).
Rotational Latency: The time taken for the target disk sector to rotate under the read-write head.
Transfer Time: The actual time to stream the binary data from disk to host system controller.
Disk Scheduling Algorithms
Because seek time dominates access latency, the OS schedules sector requests to minimize total arm movement:
Disk Algorithms Cheat Sheet
FCFS (First-Come, First-Served): Requests processed in exact order of arrival. Simple and fair, but performs no optimization.
SSTF (Shortest Seek Time First): Selects the pending request closest to the current head position. Minimizes overall head movement, but can cause **starvation** of distant cylinders if new closer requests keep arriving.
SCAN (Elevator): Arm starts at one end, moves towards the other end servicing requests, and reverses only when it hits the extreme end boundaries of the disk.
C-SCAN (Circular SCAN): Moves arm from one end to the other servicing requests. But when it hits the end, it returns directly to the starting boundary *without* servicing requests on the return trip. Provides a more uniform wait time.
LOOK / C-LOOK: Similar to SCAN/C-SCAN, but the arm only travels as far as the *last request* in each direction rather than going all the way to the absolute edge boundaries of the disk platter.