`

Storage Management

Storage management in operating systems involves handling data storage efficiently to ensure fast access and retrieval. It includes disk scheduling algorithms for optimizing disk access and buffer cache mechanisms to speed up data access.


Disk Scheduling Algorithms

When multiple requests are waiting for disk access, the operating system decides the order in which they should be serviced. The goal is to minimize seek time (the time taken by the disk arm to move to the requested track).

First-Come, First-Served (FCFS)

Example:
Consider disk requests at tracks 98, 183, 37, 122, 14, 124, 65, 67, and the head starts at 53.

Request Queue Seek Distance from Previous
98 45 (98 - 53)
183 85 (183 - 98)
37 146 (183 - 37)
122 85 (122 - 37)
14 108 (122 - 14)
124 110 (124 - 14)
65 59 (124 - 65)
67 2 (67 - 65)

Shortest Seek Time First (SSTF)

Example (Same Requests as Above):
Head at 53 → Nearest request is 65 → Then 67 → Then 37, etc.


SCAN (Elevator Algorithm)

Example:


C-SCAN (Circular SCAN)


LOOK Algorithm


C-LOOK Algorithm


Buffer Cache and Disk Caching

A buffer cache is a memory space used to store frequently accessed disk data to speed up retrieval.

How It Works

  1. When data is needed, the OS first checks the cache.
  2. If found (cache hit), it is accessed quickly.
  3. If not (cache miss), it is fetched from the disk and stored in the cache.

Types of Disk Caching

  1. Write-Through Cache: Data is written to both cache and disk simultaneously.
  2. Write-Back Cache: Data is written to the cache first, then later to the disk.