Disk Management and Scheduling

Subject: Computer Science Fundamentals · Language: Operating System · Level: intermediate · 9 min read

Understand disk structure, disk access time, disk scheduling algorithms, formatting, boot blocks, and how the OS manages storage devices.

Disk management is the operating system work related to organizing, using, and maintaining secondary storage devices such as hard disks and SSDs. Programs and users store files permanently on these devices, so the OS must manage storage carefully. Disk scheduling is a related topic. It decides the order in which pending disk input-output requests should be served. Good scheduling reduces waiting time and improves overall system performance.

For beginners, disk management can be compared with managing a large warehouse. Items must be placed in proper locations, free space must be tracked, damaged areas must be avoided, and requests must be handled in an efficient order. The operating system performs similar work for storage blocks.

Why Disk Management Is Needed

RAM is fast but temporary. Secondary storage is slower but permanent. Files, operating system data, applications, databases, videos, documents, and user settings are stored on disks or SSDs so they remain available after power is turned off. The operating system must know where data is stored, which space is free, which space is used, and how to read or write data safely. Without disk management, storage would become unorganized and unreliable. Disk management also improves performance. Reading data from storage takes time, especially on magnetic hard disks. The OS tries to reduce unnecessary movement and delays.

Disk Structure

A traditional hard disk contains rotating platters. Each platter surface is divided into tracks, and each track is divided into sectors. A sector is a small storage unit where data is stored. A group of sectors may be handled as a block by the operating system. File systems usually work with blocks because managing every tiny sector separately would be inefficient. Modern SSDs do not have rotating platters or moving heads, but operating systems still use block-based storage ideas when reading and writing data.

Tracks and Sectors

A track is a circular path on the disk surface. A sector is a small division of a track. When data is stored, it is placed inside sectors or blocks. In older hard disk explanations, tracks and sectors are important because the disk head must move to the correct track before data can be read or written. Even if many modern devices hide these details internally, the basic idea helps students understand why storage access is slower than RAM access.

Disk Access Time

Disk access time is the time required to read or write data from disk. For magnetic disks, it mainly includes seek time, rotational latency, and transfer time. Seek time is the time taken by the disk arm to move the read-write head to the required track. Rotational latency is the waiting time until the required sector comes under the head. Transfer time is the time taken to actually move data between disk and memory. The total access time matters because disk operations are much slower than CPU and RAM operations. Reducing disk delay is one reason disk scheduling algorithms are used.

Seek Time

Seek time is often the most important delay in magnetic disks. If requests are served in a poor order, the disk head may move back and forth too much. For example, if the head is near track 20 and requests arrive for tracks 90, 22, 85, and 25, serving them in arrival order may cause unnecessary movement. A better order can reduce travel distance. Disk scheduling tries to reduce this movement so requests can be completed faster.

Disk Scheduling

Disk scheduling decides which disk request should be handled next when multiple requests are waiting. The goal is to reduce seek time, improve throughput, and give fair service to processes. Disk scheduling is especially important for magnetic hard disks because the physical movement of the disk head affects speed. In SSDs, there is no moving head, but request ordering and storage management can still affect performance.

FCFS Disk Scheduling

FCFS stands for First Come, First Served. In this method, disk requests are handled in the order in which they arrive. FCFS is simple and fair because no request jumps ahead of another. However, it can be inefficient if the requests are spread across distant disk tracks. For example, the disk head may move from a low-numbered track to a high-numbered track and then back again, increasing total seek time.

SSTF Disk Scheduling

SSTF stands for Shortest Seek Time First. It chooses the request closest to the current head position. This usually reduces seek time compared with FCFS because the disk head moves to nearby requests first. It is similar to choosing the nearest task before moving farther away. The disadvantage is possible starvation. A request far away may wait for a long time if nearby requests keep arriving again and again.

SCAN Disk Scheduling

SCAN is also called the elevator algorithm. The disk head moves in one direction and serves requests along the way. When it reaches the end, it reverses direction and serves requests on the return path. This is similar to an elevator moving up and down. It does not randomly jump between floors; it serves requests in one direction and then comes back. SCAN gives more predictable service than SSTF and reduces unnecessary movement compared with FCFS.

C-SCAN Disk Scheduling

C-SCAN stands for Circular SCAN. The disk head moves in one direction and serves requests. When it reaches the end, it quickly returns to the beginning and starts again in the same direction. C-SCAN gives a more uniform waiting time because requests are served in a circular order. It treats the disk tracks like a circular list. This method is useful when the system wants more even service across all disk areas.

LOOK Disk Scheduling

LOOK is similar to SCAN, but the disk head does not move all the way to the physical end of the disk unless there is a request there. It looks ahead to see if there are pending requests in the current direction. If there are no more requests, it reverses direction. This saves extra movement compared with SCAN because the head does not travel to empty ends unnecessarily.

C-LOOK Disk Scheduling

C-LOOK is similar to C-SCAN, but it moves only as far as the last request in the current direction. Then it jumps back to the lowest pending request and continues in the same direction. Like LOOK, it avoids unnecessary travel to physical disk ends. Like C-SCAN, it gives circular-style service. C-LOOK is often explained as a more efficient version of C-SCAN for request-based movement.

Formatting

Formatting prepares a disk or partition for storing data. It creates the required file system structures so the operating system can manage files and directories. Low-level formatting divides a disk into sectors and tracks at the hardware level. High-level formatting creates file system structures such as directories, metadata areas, and free-space information. In everyday use, when users format a drive, they usually perform high-level formatting. This makes the drive ready for a file system such as NTFS, FAT32, exFAT, or ext4.

Partitions

A partition is a logical division of a storage device. One physical disk can be divided into multiple partitions. For example, a computer may have one partition for the operating system and another partition for personal files. Each partition can have its own file system. Partitions help organize storage, install multiple operating systems, separate system data from user data, and manage disk space more clearly.

Boot Block

A boot block is a special area that contains information needed to start the operating system. When the computer turns on, firmware looks for boot information and begins the boot process. The exact boot process depends on the system design, such as BIOS or UEFI, but the main idea is that storage contains special startup information. Without proper boot information, the computer may not know how to load the operating system.

Bad Blocks

Bad blocks are damaged or unreliable storage areas that cannot safely store data. They may occur due to hardware problems, wear, physical damage, or manufacturing defects. The operating system or disk controller can mark bad blocks so they are not used for storing important data. Managing bad blocks helps protect files from corruption and improves storage reliability.

Free Space Management

The OS must track free disk space so new files can be stored. File systems commonly use bitmaps, linked lists, or other structures to record free and used blocks. A bitmap marks each block as free or used. This makes it easier to find available space when creating or expanding files. Free space management is important because storage changes constantly as files are created, edited, deleted, and moved.

Disk Cache

A disk cache stores recently used disk data in memory. If the same data is needed again, the OS can provide it from RAM instead of reading from disk again. Caching improves performance because RAM is much faster than secondary storage. It is especially useful for frequently accessed files and repeated reads. However, write caching must be handled carefully. If power fails before cached writes reach the disk, data may be lost or corrupted.

SSD and Disk Scheduling

SSDs do not have moving heads, so seek time is not the same as in magnetic disks. Because of this, traditional disk scheduling algorithms are less important for SSDs than for hard disks. Still, the operating system must manage request queues, wear leveling support, caching, and efficient input-output operations. Students should understand classical disk scheduling because it explains important operating system design ideas, even though modern storage hardware has changed.

Summary

Disk management handles storage organization, formatting, partitions, free space, bad blocks, boot information, and caching. Disk scheduling decides how pending disk requests should be ordered for better performance. For beginners, the key idea is that storage is slower than RAM and must be managed carefully. The operating system hides hardware complexity while trying to keep data safe, organized, and quickly accessible.

More Operating System Lessons

Browse all PrepCampus study materials