Mass Storage Management


Disks are the mainly used mass storage devices. They provide the bulk of secondary storage in operating systems today.

Disk Structure

Each modern disk contains concentric tracks and each track is divided into multiple sectors. The disks are usually arranged as a one dimensional array of blocks, where blocks are the smallest storage unit.Blocks can also be called as sectors. For each surface of the disk, there is a read/write desk available. The same tracks on all the surfaces is known as a cylinder.

Disk Scheduling

There are many disk scheduling algorithms that provide the total head movement for various requests to the disk. Here are the types of disk scheduling algorithms −

Disk Scheduling Algorithms

All these algorithms are explained using the following requests for the disk −

10,95,23,78,80

First Come First Serve Scheduling (FCFS)

In first come first served scheduling, the requests are serviced in their coming order. This algorithm is fair as it allows all requests a chance but it does not provide the fastest possible service. An example of FCFS scheduling is given below −

In the above example, the requests are serviced in the order they appear i.e 10, 95, 23, 78, 80. The seek head is initially positioned at 50 and it starts from there.

Shortest Seek Time First Scheduling

The requests that are closest to the current head are served first before moving away in shortest seek time first scheduling algorithm. A problem with SSTF algorithm is that it may cause starvation for some requests. An example of Shortest Seek Time First Scheduling is given below −

SSTF Disk Scheduling

In the above example, the requests are serviced in the order 23, 10, 78, 80, 95. The seek head is initially positioned at 50 and it starts from there. 23 is closest to 50 so it is services first. Then 10 is closer to 23 than 78 so it is services next. After this 78, 80 and 95 are serviced.

SCAN Scheduling

In this scheduling algorithm, the head moves towards one direction while servicing all the requests in that direction until it reaches the end of the disk. After that it starts moving towards the other direction. In this way, the head continuously scans back and forth across the disk. An example of SCAN scheduling is given below −

Disk Scheduling

In the above example, the requests are serviced in the order 23, 10, 78, 80, 95. The head is initially at 50 and moves towards the left while servicing requests 23 and 10. When it reaches the end of the disk, it starts moving right and services 78, 80 and 95 as they occur.

LOOK Scheduling

LOOK scheduling algorithm is similar to SCAN scheduling but is its practical version. In this algorithm, the head moves towards one direction while servicing all the requests in that direction until it reaches the last request. After that it starts moving towards the other direction. An example of LOOK scheduling is given below −

LOOK Disk Scheduling

In the above example, the requests are serviced in the order 23, 10, 78, 80, 95. The head is initially at 50 and moves towards the left while servicing requests 23 and 10. When it reaches the last request on the left i.e. 10, it starts moving right and services 78, 80 and 95 as they occur.

Updated on: 22-Jun-2020

7K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements