Disk Scheduling Algorithms in OS: FCFS, SSTF, SCAN, C-SCAN, LOOK & C-LOOK
A hard disk can receive many read and write requests at the same time. If the disk head moves randomly from one cylinder to another, a large amount of time can be wasted only in head movement.
Disk Scheduling Algorithms decide which pending disk request should be served next so that seek movement, waiting time and I/O overhead can be controlled.
The main algorithms studied in Operating System are FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK.
Disk Scheduling is the operating-system technique used to decide the order in which pending disk I/O requests should be served.
FCFS serves requests in arrival order.
SSTF serves the request nearest to the current disk head.
SCAN moves like an elevator toward one disk end and then reverses.
C-SCAN serves requests in one direction and then returns to the opposite end.
LOOK works like SCAN but reverses at the last request instead of moving unnecessarily to the physical disk boundary.
C-LOOK is the circular version of LOOK.
First Understand How a Hard Disk Works
Traditional Hard Disk Drives store data on magnetic circular platters. Data is organised into tracks and sectors. A read/write head must move to the required position before data can be accessed.
What Is a Disk Cylinder?
When multiple platters are used, tracks at the same radius across platter surfaces form a cylinder.
In most Operating System numerical questions, requests are represented by cylinder numbers.
Disk cylinders: 0 to 199
Current head position: 53
Pending request: 98
Seek Time, Rotational Latency and Transfer Time
Average Rotational Latency Example
Suppose a hard disk rotates at:
Average rotational latency:
Why Do We Need Disk Scheduling?
Several processes can generate disk requests at almost the same time.
Suppose the current head is at Cylinder 53 and pending requests are:
The operating system must decide: Which request should be served first?
Reduce total head movement
Reduce seek time
Improve throughput
Reduce average waiting time
Improve response time
Provide reasonable fairness
Avoid starvation where possible
Visualising a Disk Request Queue
Important Terms in Disk Scheduling Numericals
Six Important Disk Scheduling Algorithms
First Come First Serve
Serve requests in arrival order.
Shortest Seek Time First
Serve the request closest to the current head.
Elevator Algorithm
Move in one direction to the disk boundary, then reverse.
Circular SCAN
Serve in one direction, jump back and continue in the same direction.
Smarter SCAN
Reverse at the last pending request, not the physical disk end.
Circular LOOK
Move to the last request in one direction, jump to the opposite pending request.
Common Example Used for All Algorithms
FCFS Disk Scheduling Algorithm
FCFS stands for First Come First Serve.
Requests are served in exactly the same order in which they enter the disk request queue.
First request in queue = First request served.
FCFS Solved Example
Total Head Movement = 640 cylinders
Advantages and Disadvantages of FCFS
| Advantages | Disadvantages |
|---|---|
| Very simple to implement | Can produce very large head movement |
| Requests are treated in arrival order | Poor average seek time in many workloads |
| Does not normally starve old requests | Does not consider request location |
SSTF Disk Scheduling Algorithm
SSTF stands for Shortest Seek Time First.
From the current head position, the algorithm chooses the pending request with the smallest cylinder distance.
Next request = Nearest pending cylinder.
From Head 53:
SSTF Solved Example
Total Head Movement = 236 cylinders
Can SSTF Cause Starvation?
Yes.
Suppose the head is serving many requests around Cylinders 50 to 80. A request at Cylinder 190 may wait for a very long time if new nearby requests continuously arrive.
SCAN Disk Scheduling Algorithm
SCAN is often called the Elevator Algorithm.
Imagine an elevator moving upward. It serves all requested floors in that direction, reaches the end, and then moves in the opposite direction.
Move in one direction → serve requests on the way → reach disk boundary → reverse direction.
SCAN Solved Example
Initial direction: toward higher cylinders.
Total Head Movement = 331 cylinders
C-SCAN Disk Scheduling Algorithm
C-SCAN means Circular SCAN.
The disk head serves requests only while moving in one direction.
When it reaches the end, it jumps to the opposite end and starts serving in the same direction again.
Serve in one direction → reach disk end → jump to opposite end → continue in same direction.
C-SCAN Solved Example
Total Head Movement = 382 cylinders
LOOK Disk Scheduling Algorithm
LOOK is similar to SCAN, but it avoids unnecessary travel to the physical disk boundary.
The head only goes as far as the last pending request in the current direction.
Move in one direction → serve all pending requests → reverse at the last request.
SCAN may move to Cylinder 199.
LOOK stops at Cylinder 183 in this example because there is no request beyond 183.
LOOK Solved Example
Total Head Movement = 299 cylinders
C-LOOK Disk Scheduling Algorithm
C-LOOK combines the circular idea of C-SCAN with the boundary-saving idea of LOOK.
The head moves only up to the last pending request, then jumps to the first pending request on the opposite side.
Serve requests in one direction → stop at last request → jump to first pending request on the other side → continue in same direction.
C-LOOK Solved Example
Total Head Movement = 322 cylinders
FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK Results
For the same queue, head position and initial direction:
Difference Between Disk Scheduling Algorithms
| Algorithm | Selection Rule | Direction Required? | Starvation Risk | Main Idea |
|---|---|---|---|---|
| FCFS | Arrival order | No | Very low | Simple queue |
| SSTF | Nearest request | No | Possible | Minimum immediate seek |
| SCAN | Serve requests while moving toward disk end | Yes | Lower than SSTF | Elevator movement |
| C-SCAN | Serve in one direction only | Yes | Low | More uniform directional service |
| LOOK | SCAN without unnecessary disk-end travel | Yes | Low | Reverse at last request |
| C-LOOK | Circular LOOK movement | Yes | Low | Jump between extreme pending requests |
SCAN vs LOOK
| Basis | SCAN | LOOK |
|---|---|---|
| Movement | Moves to physical disk boundary before reversing | Stops at last pending request |
| Unnecessary Travel | Possible | Reduced |
| Example | May move to Cylinder 199 | May stop at Cylinder 183 |
C-SCAN vs C-LOOK
| Basis | C-SCAN | C-LOOK |
|---|---|---|
| Forward End | Moves to disk boundary | Moves only to last pending request |
| Return | Jumps to opposite disk boundary | Jumps to opposite extreme pending request |
| Unnecessary Movement | Can be higher | Usually reduced |
SSTF vs SCAN
SSTF makes a locally attractive decision: select the nearest current request.
SCAN follows a stable movement direction.
SCAN = serve requests along one organised sweep
Average Head Movement Formula
= Total Head Movement / Number of Requests
For SSTF in our example:
Calculating Approximate Seek Time from Head Movement
Some exam questions may provide an approximate time per cylinder.
Why Initial Direction Matters in SCAN, C-SCAN, LOOK and C-LOOK
Direction-based algorithms need to know whether the head initially moves toward lower cylinder numbers or higher cylinder numbers.
If the direction changes, the service order and total head movement can also change.
Common Mistakes in Disk Scheduling Numericals
Mistake 1: Forgetting the Initial Head Position
The first movement always starts from the given head position.
Mistake 2: Sorting FCFS Requests
FCFS must use the original arrival order.
Mistake 3: Choosing the Globally Smallest Cylinder in SSTF
SSTF chooses the cylinder nearest to the current head, not simply the smallest pending cylinder.
Mistake 4: Treating SCAN and LOOK as the Same
SCAN moves to the physical boundary. LOOK reverses at the last request.
Mistake 5: Treating C-SCAN and C-LOOK as the Same
C-SCAN uses physical disk boundaries. C-LOOK uses extreme pending requests.
Mistake 6: Ignoring Circular Jump Distance
In most textbook calculations, the circular return movement contributes to total head movement.
Mistake 7: Ignoring Direction
Direction directly affects SCAN-family results.
Fairness and Starvation in Disk Scheduling
| Algorithm | Fairness Idea | Starvation |
|---|---|---|
| FCFS | Arrival-order fairness | Usually not a major problem |
| SSTF | Favors nearby requests | Possible |
| SCAN | Systematic sweep | Much less likely |
| C-SCAN | More uniform directional waiting | Low |
| LOOK | SCAN-style service without empty travel | Low |
| C-LOOK | Circular service over requested range | Low |
Are These Algorithms Important for SSDs Too?
FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK were developed mainly around mechanical hard disks.
An SSD has no mechanical read/write head that must physically move from Cylinder 20 to Cylinder 180.
SSD: no mechanical seek head, so traditional cylinder-based scheduling has much less relevance.
Modern storage stacks can still schedule and merge I/O requests for latency, throughput, fairness and device characteristics, but the reason is no longer simply mechanical head movement.
Disk Scheduling in Modern Systems
Real operating systems may use more advanced I/O schedulers than the classic textbook algorithms.
Storage controllers can also perform their own request reordering. Modern HDDs may support command queuing, while SSD and NVMe devices have highly different internal architectures.
Related Disk Scheduling Variants
Best Method to Solve Disk Scheduling Numericals
- Write the complete request queue exactly as given.
- Note the initial disk-head position.
- Note minimum and maximum cylinder numbers.
- For SCAN-family algorithms, write the initial direction.
- Arrange requests only when the chosen algorithm requires it.
- Write the complete service route.
- Calculate absolute movement between every two consecutive positions.
- Add all movements carefully.
- Recheck boundary movement for SCAN and C-SCAN.
- Recheck circular jump for C-SCAN and C-LOOK.
Interactive Disk Scheduling Simulator
Enter your own request queue, initial head position, disk range, direction and algorithm.
One-Minute Disk Scheduling Revision
Disk Scheduling Algorithms Exam Preparation
2-Mark Definition
Disk Scheduling is the operating-system technique used to determine the order in which pending disk I/O requests are serviced.
FCFS
FCFS serves disk requests in the same order in which they arrive.
SSTF
SSTF selects the pending request closest to the current disk-head position.
SCAN
SCAN moves the disk head in one direction, servicing requests on the way until the disk boundary is reached, then reverses direction.
C-SCAN
C-SCAN serves requests in one direction only. After reaching one disk end, the head returns to the opposite end and continues in the same direction.
LOOK
LOOK works like SCAN but reverses at the last pending request instead of travelling to the physical disk boundary.
C-LOOK
C-LOOK serves requests in one direction up to the final pending request, then jumps to the first pending request on the other side.
Important Numerical Formula
For a 5-Mark Answer
- Define Disk Scheduling.
- Explain seek time.
- Define FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK.
- Mention starvation in SSTF.
- Write one difference table.
For a 10-Mark Answer
- Hard disk structure.
- Track, sector, cylinder and head.
- Seek time.
- Rotational latency.
- Need for Disk Scheduling.
- FCFS working and numerical.
- SSTF working and numerical.
- SSTF starvation.
- SCAN working and numerical.
- C-SCAN working and numerical.
- LOOK working and numerical.
- C-LOOK working and numerical.
- Comparison table.
- Advantages and disadvantages.
- HDD vs SSD relevance.
Frequently Asked Questions
What is Disk Scheduling in Operating System?
Disk Scheduling is the operating-system technique used to decide the order in which pending disk I/O requests should be serviced.
Why is Disk Scheduling needed?
Disk Scheduling helps reduce unnecessary head movement, seek time and waiting time while improving disk throughput.
What is FCFS Disk Scheduling?
FCFS serves requests in the same order in which they arrive.
What is SSTF Disk Scheduling?
SSTF selects the pending request closest to the current disk-head position.
Can SSTF cause starvation?
Yes. A request far from the current disk head may wait for a long time if nearby requests continue to arrive.
What is SCAN Disk Scheduling?
SCAN moves the head in one direction, serves requests along the path, reaches the disk boundary and then reverses direction.
Why is SCAN called the Elevator Algorithm?
SCAN behaves like an elevator that serves requests while moving in one direction and then reverses after reaching an end.
What is C-SCAN?
C-SCAN serves requests in one direction only and then returns to the opposite disk end before continuing in the same direction.
What is LOOK Disk Scheduling?
LOOK works like SCAN but reverses at the last pending request instead of travelling to the physical disk boundary.
What is C-LOOK Disk Scheduling?
C-LOOK is the circular version of LOOK. It serves requests in one direction, then jumps from the last request to the opposite extreme pending request.
What is the main difference between SCAN and LOOK?
SCAN goes to the physical disk boundary, while LOOK reverses at the last pending request.
What is the difference between C-SCAN and C-LOOK?
C-SCAN uses physical disk boundaries, while C-LOOK uses the highest and lowest pending requests.
Do SSDs need traditional Disk Scheduling?
SSDs do not have a mechanical disk head, so traditional seek-based cylinder scheduling is much less important. Modern operating systems may still schedule SSD I/O for other performance and fairness reasons.
Conclusion
Disk Scheduling Algorithms decide the order in which pending storage requests are processed.
For mechanical hard disks, good scheduling can reduce read/write-head movement and therefore reduce seek overhead.
FCFS is simple and follows arrival order, but can create large head movement.
SSTF chooses the nearest request and can reduce immediate movement, but far-away requests can suffer starvation.
SCAN provides an organised elevator-like sweep across cylinders.
C-SCAN serves requests in one direction to provide more uniform directional service.
LOOK improves the SCAN idea by avoiding unnecessary movement to a disk end where no request exists.
C-LOOK applies the same improvement to circular scanning.
These algorithms are especially important for understanding mechanical HDD behaviour, seek optimisation, starvation, fairness and storage I/O scheduling.
FCFS = Arrival Order
SSTF = Nearest Request
SCAN = Go to End and Reverse
C-SCAN = One Direction + Circular Return
LOOK = Reverse at Last Request
C-LOOK = Circular Jump Between Last Requests
SSTF = Starvation Possible
LOOK = SCAN Without Unnecessary Boundary Travel
