Disk Scheduling Algorithms in Operating Systems: Types

Published: 27 Nov 2025 | Reading Time: 6 min read

Table of Contents

Key Takeaways From the Blog

Introduction

Disk scheduling in an operating system (OS) is required to make disk drive operation as efficient as possible. As there is more than one process involved in current systems, all of which attempt to access the disk, disk scheduling algorithms assist in queuing these requests to optimise disk access. Disk scheduling attempts to reduce the time spent by the read/write head of the disk traveling, which improves the overall system performance. The algorithms can lead to less waiting time and an active system.

This article will discuss disk scheduling algorithms in operating systems, types and examples with advantages and disadvantages.

What Are Disk Scheduling Algorithms in OS?

Disk scheduling algorithms control the sequence of disk I/O (input/output) requests being executed. The fundamental concept is to reduce disk arm movement so that it serves all the requests with minimum overhead. Essentially, these algorithms decide the order of operation or the path through which the disk access requests are executed.

Disk scheduling is important because the hard disk is one of the slower devices in the system, particularly relative to the CPU and memory. As a result, effectively managing how and when data is read or written to disk can impact system performance. Disk scheduling prevents these I/O requests from being serviced in a manner that will cause delays and reduce throughput.

Quick Note: Disk scheduling is essential because disk access is slow; optimizing request order significantly improves overall OS performance.

Key Terms of Disk Scheduling in Operating Systems

Disk scheduling is a method that deals with how the requests for disk input/output are carried out to achieve the highest performance. The following are the essential terms related to disk scheduling:

1. Seek Time

Seek time is the time that the disk arm is being moved to the track which has the required data. It is the main factor of disk performance and the most important parameter in the development of disk access.

2. Rotational Latency

At rotational latency, the read/write head is waiting for the arrival of the desired sector. In order to reduce the rotational latency to a minimal value, it is necessary to have high disk speeds, which therefore leads to an overall improvement of the disk efficiency and the data-accessing speed.

3. Transfer Time

Transfer time is the time that is taken for the data to be moved to memory after the read/write head is positioned. Generally, it is less than the seek time and the rotational latency.

4. Disk Access Time

Disk access time is the sum of time consumed by a disk operation, i.e., seek time, rotational latency, and transfer time. It shows the effectiveness of reading data from a disk.

5. Disk Response Time

Disk response time is a request's average wait time to complete its I/O operation. Reduced response times mean superior scheduling and better system performance.

6. Starvation

Starvation is when a request has to wait forever because other requests are always serviced with a higher priority. Disk scheduling algorithms prevent starvation by ensuring each request has an equal opportunity.

Key Takeaways So Far:

Types of Disk Scheduling Algorithms in OS

Several disk scheduling algorithms are designed to optimize different aspects of disk access. Below are some of the most common disc scheduling algorithms:

1. FCFS Disk Scheduling Algorithm

The FCFS disk scheduling algorithm serves disk access requests based on their arrival time, regardless of their physical location on the disk. The earliest arrived request is served first, making it one of the simplest and easiest-to-implement scheduling algorithms.

Example

We have a disk containing 200 tracks (track 0 to track 199). The request sequence is (60, 150, 25, 130, 80, 10, 190). The disk head's initial position is 50.

Explanation

In the FCFS (First Come, First Serve) disk scheduling algorithm, the disk arm goes through each request in their arrival order, not moving the head optimally.

Seek Time Calculation

Seek time is computed as the sum of the absolute differences of the current disk head position and the target track.

Seek Time = (60−50)+(150−60)+(150−25)+(130−25)+(130−80)+(80−10)+(190−10)
          = 10+90+125+105+50+70+180
          = 630

Advantages

Here are the advantages of FCFS disk scheduling:

Disadvantages

Here are the disadvantages of FCFS disk scheduling:

Quick Note: FCFS processes requests strictly by arrival order, making it fair but extremely inefficient when requests are physically far apart.

2. SSTF Disk Scheduling Algorithm

The SSTF disk scheduling algorithm chooses the closest request to the disk arm's current location. The disk arm moves to the closest requested track and, when it completes, moves to the next closest request. SSTF always chooses the closest request and, therefore, minimizes the seek time.

Example

Suppose the same 200-track disk (0-199). The order of requests is: (60, 150, 25, 130, 80, 10, 190). The head's initial position is 50.

Explanation

In the SSTF algorithm, the disk arm travels to the request nearest to its current position, reducing seek time per move.

Calculation of Seek Time

Seek Time = (60−50)+(80−60)+(130−80)+(150−130)+(190−150)+(25−190)+(10−25)
          = 10+20+50+20+40+165+15
          = 320

Advantages

Here are the advantages of SSTF disk scheduling:

Disadvantages

Here are the disadvantages of SSTF disk scheduling:

Key Takeaway: SSTF improves performance but can lead to starvation for far requests.

3. SCAN Disk Scheduling Algorithm

The SCAN disk scheduling algorithm has the disk arm travel in one direction (either from the innermost track to the outermost track or vice versa), servicing all requests along the way. The arm switches directions at the end of the disk and continues servicing requests in the opposite direction. This technique is also called the elevator algorithm, which was named after the direction the arm moves back and forth.

Example

The same disk with 200 tracks (0-199). The sequence of requests is: (60, 150, 25, 130, 80, 10, 190). The head starts at position 50.

Explanation

Calculation of Seek Time

Seek Time = (199−50)+(199−10)
          = 149+189
          = 338

Advantages

Disadvantages

Key Takeaway: SCAN is efficient but may cause unnecessary movement to the disk ends.

4. C-SCAN Disk Scheduling Algorithm

The C-SCAN disk scheduling algorithm is the same as SCAN, with one significant difference: when the disk arm hits the end of the disk, it returns to the beginning without serving any requests in the return direction. It then serves requests in only one direction, which makes the disk arm movement more consistent.

Example

Assume the same disk is divided into 200 tracks (0-199). The request sequence is: (60, 150, 25, 130, 80, 10, 190). The head is currently at location 50.

Explanation

Calculation of Seek Time

Seek Time = (199−50)+(199−0)+(43−0)
          = 149+199+43
          = 391

Advantages

Disadvantages

Bottom Line: C-SCAN offers consistent performance and fairness by preventing priority bias toward middle tracks.

5. LOOK Disk Scheduling Algorithm

The LOOK disk scheduling algorithm is like SCAN but with one advancement. Unlike SCAN, LOOK never goes to the end of the disk (although there are no requests there). It goes only as far as the farthest request in its direction. After it satisfies the farthest request, it changes direction and begins to satisfy the remaining requests.

Example

Suppose the same disk with 200 tracks (0-199). The sequence of requests is: (60, 150, 25, 130, 80, 10, 190). The head starts at position 50.

Explanation

Calculation of Seek Time

Seek Time = (150−50)+(150−10)
          = 100+140
          = 240

Advantages

Here are the advantages of LOOK disk scheduling:

Disadvantages

Here are the disadvantages of LOOK disk scheduling:

Quick Note: LOOK stops at the last request instead of the disk edge, reducing unnecessary travel and improving efficiency over SCAN.

6. C-LOOK Disk Scheduling Algorithm

The C-LOOK (Circular LOOK) disk scheduling algorithm is an enhanced version of the LOOK algorithm. Similar to LOOK, the disk arm travels in one direction to the farthest request. However, rather than traveling to the end of the disk, when it reaches the farthest request, it jumps to the start and continues serving requests in the same direction.

Example

Imagine the same 200-track disc (0-199). The head's initial position is 50. The request sequence is: (60, 150, 25, 130, 80, 10, 190).

Explanation

The C-LOOK (Circular LOOK) algorithm is the same as LOOK, except that it does not reach the end of the disk while returning. Instead, it jumps back to the last request in the opposite direction after serving the furthest request and continues serving.

The disk arm begins at 50, travels to 150, then jumps to 10, serving all requests in between.

Calculation of Seek Time

Seek Time = (150−50)+(150−10)+(190−10)
          = 100+140+180
          = 420

Advantages

Here are the advantages of C-LOOK disk scheduling:

Disadvantages

Here are the disadvantages of C-LOOK disk scheduling:

Bottom Line: C-LOOK combines consistency with minimized travel, making it one of the most efficient scheduling techniques.

Other Disk Scheduling Algorithms

In addition to the popular algorithms like SCAN, C-LOOK disk scheduling algorithm, and FCFS, there are a few other disk scheduling methods that provide solutions for different scenarios or system requirements. These methods are mostly significant in the context of random due dates, random processing times, random weights, and situations where the starvation of requests and stochastic machine breakdowns are possible.

1. Random Scheduling

Random Scheduling chooses the next I/O request randomly from the disk queue without consideration of the position or arrival time. This method is mainly used for performance evaluation and system simulation in which random processing time or random due dates are the major factors. Although it does not minimize seek time, it can serve as a way to model unpredictable workloads or check system stability.

2. Last-In First-Out (LIFO) Algorithm

Last-In First-Out algorithm is the one that performs the I/O operation that has been most recently requested by the user. In this way, it is possible to maximize the locality and resource utilization since the newer requests may be related to each other or be in the same cluster. However, LIFO can lead to the phenomenon of starvation of requests that arrived earlier if new requests continue to come, as older requests may be constantly deferred.

3. N-STEP SCAN

N-STEP SCAN organizes the disk queue into sub-queues or buffers of N requests each. All requests in the current buffer are serviced using the SCAN disk scheduling algorithm, and new requests are held in subsequent buffers until the current one is completed. This method guarantees service for all requests in a buffer and prevents starvation, as every request is eventually processed in its turn.

4. F-SCAN

F-SCAN improves upon N-STEP SCAN by using two sub-queues: one for current requests and one for new arrivals. During each scan, only the requests present in the active queue at the start are serviced, while new requests are added to the secondary queue and held until the next scan. This approach helps prevent the disk arm from getting stuck servicing a continuous stream of new requests and ensures fairness and guaranteed service.

Key Takeaways So Far:

  1. Disk scheduling aims to minimize seek time and optimize disk arm movement.
  2. Algorithms like FCFS, SSTF, SCAN, and C-SCAN differ in efficiency and fairness.
  3. Each algorithm has its strengths and weaknesses depending on the workload and system requirements.
  4. Advanced algorithms like LOOK and C-LOOK address inefficiencies in SCAN and C-SCAN by avoiding unnecessary travel.

Practice Problems and Solutions

To solidify your understanding of disk scheduling algorithms, let's work through several example problems. These practical scenarios demonstrate how to apply the algorithms and calculate key metrics like seek time.

Problem 1: FCFS Disk Scheduling Algorithm

Scenario: A disk has cylinders numbered from 0 to 199. The disk queue contains I/O requests for the following cylinders in order: 98, 183, 41, 122, 14, 124, 65, 67. The disk head starts at cylinder 53.

Calculate: The total head movement (seek time) incurred while servicing these requests using the FCFS disk scheduling algorithm.

Solution:

Calculate the movement for each step (absolute difference):

  1. |98 – 53| = 45
  2. |183 – 98| = 85
  3. |41 – 183| = 142
  4. |122 – 41| = 81
  5. |14 – 122| = 108
  6. |124 – 14| = 110
  7. |65 – 124| = 59
  8. |67 – 65| = 2

Total Seek Time = 45 + 85 + 142 + 81 + 108 + 110 + 59 + 2 = 632

Problem 2: Randomized Job Attributes

Scenario: Suppose you have a disk with blocks of disk numbered 0–199. The disk queue contains requests with random due dates, random processing times, and random weights due to stochastic machine breakdowns. The requests arrive at: 25, 89, 132, 45, 10. The head starts at 50.

Question: If the requests have the following random weights (importance):

And the processing times are:

How would you prioritize the disk queue if you wanted to minimize total weighted seek time, and what would the seek time be for your chosen order?

Solution: One approach is to serve requests in order of highest weight first, breaking ties by shortest processing time:

Order: 45 (5), 10 (4), 25 (3), 132 (2), 89 (1)

Calculate seek times:

  1. |45 – 50| = 5
  2. |10 – 45| = 35
  3. |25 – 10| = 15
  4. |132 – 25| = 107
  5. |89 – 132| = 43

Total Seek Time = 5 + 35 + 15 + 107 + 43 = 205

Problem 3: Dealing with Stochastic Machine Breakdowns

Scenario: A disk scheduling system faces stochastic machine breakdowns, causing delays in servicing I/O requests. Given a disk queue of requests: 30, 70, 110, 150, with the head at 40, and a breakdown occurs after servicing the second request, causing a 5ms delay.

Question: Calculate the total seek time and account for the breakdown delay.

Solution: Order: 70, 110, 150

  1. |70 – 40| = 30
  2. |110 – 70| = 40
    • Machine breakdown: add 5ms delay
  3. |150 – 110| = 40

Total Seek Time = 30 + 40 + 40 = 110

Total Time Including Delay = 110 (seek) + 5 (breakdown) = 115

Key Takeaways So Far:

Conclusion

To sum up, disk scheduling algorithms are a major factor of the success of operations related to disk I/O in an operating system. From FCFS to C-LOOK, all algorithms have their pros and cons, and the best algorithm depends on the particular system requirements. The algorithms in question work to reduce the time it takes to move the disk arm thus they minimize seek time, rotational latency, and system performance. Understanding the advantages and disadvantages of each disk scheduling algorithm is the key to making the best speed-fairness-resource utilization tradeoff in different computer systems.

Why It Matters?

Scheduling of the disk is one of the performance factors of the OS that cannot be overlooked. Good algorithms are the cause of very few I/O operations delays thus they contribute to the system's responsiveness. In such environments where I/O requests are abundant, perfecting disk scheduling can have a great positive effect on throughput and user experience.

Practical Advice for Learners

Frequently Asked Questions

What is Disk Scheduling?

Disk scheduling is the process for scheduling the sequence in which disk I/O requests are serviced. The primary objective is to maximize the efficiency of disk operations, minimize the time required by each I/O operation, and achieve fairness among competing processes.

Why is Disk Scheduling Important?

Disk scheduling is necessary because it has a direct relation to system performance. Proper disk scheduling results in quick data access, the optimum utilization of disk resources, and minimizing aggregate I/O operation time. Bad disk scheduling can result in huge seek times and response times, making the system inefficient.

What are the Different Types of Disk Scheduling Algorithms?

The common types of disk scheduling algorithms are:

Each algorithm operates in servicing disk I/O requests differently regarding efficiency, fairness, and complexity.

What is the difference between C-SCAN and SCAN algorithms?

SCAN and C-SCAN have the disk arm scanning from one side of the disk to the other. The only difference is:

Related Articles


About NxtWave

NxtWave is a technology education platform offering comprehensive programs in software development, data analysis, and emerging technologies. Contact: [email protected] | WhatsApp: +919390111761