Disk Architecture, Management & Scheduling

Operating Systems Part 9

ยท

4 min read

Disk Architecture, Management & Scheduling

Hard Disk Architecture In Operating Systems

  • Multiple platters are connected together by a spindle and spin together in either clockwise or anticlockwise direction.
  • Each platter has an upper surface and a lower surface.
  • Each platter has a read/write head and all the heads are connected to an Actuator Arm. They are used for writing and retrieval of data and move back and forth on the platter.
  • Each platter has many circular tracks on both the surfaces.
  • The read/write head moves from one track to another.
  • Each track has sectors.
  • Data is stored in sectors.
  • Platter -> Surfaces -> Tracks -> Sectors -> Data

Disk Access Time

  1. Seek Time - Time taken by R/W head to reach desired track.
  2. Rotational Time - Time taken for one full rotation(360 degrees).
  3. Rotational Latency - Time taken to reach desired sector(half of rotation time).
  4. Transfer Time - Data to be Transfer/Transfer Rate
  5. Transfer Rate(Data Rate) - No. of heads/surfaces X Capacity of one Track X No. of rotations in one second

Disk Scheduling Algorithms

Goal : To minimize seek time.

  1. FCFS(First Come First Serve)
  2. SSTF(Shortest Seek Time First)
  3. SCAN
  4. LOOK
  5. C-SCAN(Circular SCAN)
  6. C-LOOK(Circular LOOK)

FCFS

  • The R/W head serves the requests in the request queue in a first come first serve manner.
  • Direction is not necessary, the R/W head decides in which direction to move based on the request.
  • Calculate the total number of R/W movement.

SSTF

  • The R/W head serves the requests which have the lowest seek time from its current position.
  • The advantage is lower seek time and better response time, leading to better disk performance
  • One problem can be starvation of certain requests.
  • At every step, calculations have to be done for the shortest distance.
  • Direction is not necessary, the R/W head decides in which direction to move based on which request is closest.
  • Calculate the total number of R/W movement.

SCAN

  • Also called Elevator algorithm.
  • Requires direction to be known.
  • The R/W head moves till the last point in a direction.
  • Serves all requests in a direction till the last request in that direction has been served and then serves requests in the other direction.
  • The R/W after serving requests in a direction, moves till the last point, but when it serves requests in the second direction, it goes till the last request only.
  • Disadvantage is that once the R/W head changes its direction, it will serve all the requests in that direction first, even if a request in the previous direction is much closer. Starvation of requests can occur.
  • Calculate the total number of R/W movement.

LOOK

  • LOOK is similar to SCAN but the R/W head here doesnt need to move till the end of one direction.
  • The R/W head serves all directions in one direction, goes till the last request and changes its direction from there.
  • The extra distance covered by SCAN is not there in LOOK.
  • Calculate the total number of R/W movement.

C-SCAN(Circular SCAN)

  • Direction must be known.
  • The R/W head serves all requests in the direction specified, and goes till the end of that direction. This part is similar to SCAN.
  • The R/W head travels to the last point of the other side. No requests are fulfilled in this movement.
  • The R/W head now serves all the pending requests by starting from the extreme position, be it start or end.
  • Calculate the total number of R/W movement.

C-LOOK(Circular LOOK)

  • Direction must be known.
  • The R/W head serves all request in the specified direction, and changes direction from the last request and goes till the last request of the other end.
  • When the R/W head is coming back, no request is served.
  • The R/W head after reaching the last request of the other end, now serves all the remaining requests.
  • Calculate the total number of R/W movement.

Conclusion

You can read other articles written by me through these links.

Operating System Series
1. Introduction & Types of OS
2. Process States & Lifecycle
3. System Calls
4. User Mode vs Kernel Mode
5. CPU Process Scheduling
6. Process Synchronization
7. Deadlocks
8. Memory Management
9. Disk Management & Scheduling
10. File System in OS
11. Protection & Security

System Design Series
Introduction To Parallel Computing
Deep Dive Into Virtualization
Insights Into Distributed Computing

Cloud Computing Series
1. Cloud Service Models
2. Cloud Deployment Models
3. Cloud Security
4. Cloud Architecture
5. Cloud Storage
6. Networking In The Cloud
7. Cloud Cost Management
8. DevOps In Cloud & CI/CD
9. Serverless Computing
10. Container Orchestration
11. Cloud Migration
12. Cloud Monitoring & Management
13. Edge Computing In Cloud
14. Machine Learning In Cloud

Computer Networking Series
1. Computer Networking Fundamentals
2. OSI Model
3. TCP/IP Model : Application Layer
4. TCP/IP Model : Transport Layer
5. TCP/IP Model : Network Layer
6. TCP/IP Model : Data Link Layer

Version Control Series
1. Complete Guide to Git Commands
2. Create & Merge Pull Requests
3. Making Open Source Contributions

Linux
Complete Guide to Linux Commands

Thanks For Reading! ๐Ÿ’™
Garvit Singh

ย