IT501 Operating System - Unit 5

Disk Scheduling, File Management & Distributed Systems

Premium textbook-style notes for RGPV IT501 Operating System Unit 5. This page covers disk scheduling, file concepts, file manager, file organization, access methods, allocation methods, free space management, directory systems, file protection, Linux file management and introduction to distributed systems.

Unit 5 Exam Focus

Disk SchedulingVery High
File AllocationHigh
Directory SystemHigh
Linux File SystemMedium
Distributed SystemMedium

IT501 Unit 5 Syllabus

All topics below are arranged according to the RGPV IT501 Operating System Unit 5 syllabus.

Disk Scheduling
File Concepts
File Manager
File Organization
Access Methods
Allocation Methods
Free Space Management
Directory Systems
File Protection
File Organization & Access Mechanism
File Sharing Implementation Issue
File Management in Linux
Introduction to Distributed Systems

1. Disk Scheduling

Disk scheduling is the technique used by the operating system to decide the order in which disk read and write requests are executed. Since multiple processes may request access to the hard disk at the same time, an efficient scheduling algorithm helps reduce waiting time, improve response time and increase overall system performance.

Definition:
Disk Scheduling is the process of selecting the next disk I/O request to be serviced in order to minimize seek time and improve disk performance.

Objectives of Disk Scheduling

  • Reduce seek time.
  • Reduce rotational delay.
  • Increase disk throughput.
  • Improve response time.
  • Provide fairness to all requests.
Application ↓ Operating System ↓ Disk Scheduler ↓ Hard Disk ↓ Read / Write Operation

2. FCFS (First Come First Serve)

FCFS is the simplest disk scheduling algorithm. Requests are served in the same order in which they arrive.

Working

Request 1
Request 2
Request 3
Request 4

Advantages

  • Simple to implement.
  • No starvation.
  • Fair scheduling.

Disadvantages

  • High seek time.
  • Poor average response time.
  • Low throughput.
★★★★★ Frequently asked as comparison question.

3. SSTF (Shortest Seek Time First)

SSTF selects the disk request that is closest to the current head position. It reduces total head movement compared to FCFS.

Current Head ↓ Nearest Request ↓ Execute ↓ Repeat

Advantages

  • Lower seek time.
  • Better performance than FCFS.
  • Higher throughput.

Disadvantages

  • Starvation is possible.
  • Long waiting requests may be ignored.

4. SCAN Algorithm

The SCAN algorithm moves the disk head in one direction, servicing all requests until it reaches the end of the disk. It then reverses direction and services requests on the return path.

← ← ← Disk Head → Service Requests ↓ Reach End ↓ Reverse Direction

Advantages

  • Better throughput.
  • Less starvation.
  • Efficient for heavy workloads.

Disadvantages

  • Some requests wait longer.
  • More head movement than LOOK.

5. C-SCAN (Circular SCAN)

C-SCAN moves the head only in one direction. After reaching the last track, the head returns directly to the first track without servicing requests during the return journey.

Start → ↓ Service Requests ↓ Last Track ↓ Jump to First Track ↓ Continue

Advantages

  • Uniform waiting time.
  • Fair scheduling.
  • Suitable for multi-user systems.

Disadvantages

  • Additional head movement.
  • Return path is unused.

6. LOOK Algorithm

LOOK is an improved version of SCAN. Instead of moving to the last cylinder, the disk head reverses as soon as there are no more requests in the current direction.

LOOK saves unnecessary head movement and improves performance.

Advantages

  • Less seek time than SCAN.
  • Improved efficiency.
  • Better response time.

7. C-LOOK Algorithm

C-LOOK is the circular version of LOOK. The disk head services requests in one direction only and jumps directly to the first pending request instead of moving to the beginning of the disk.

Advantages

  • Uniform waiting time.
  • Reduced unnecessary movement.
  • Better performance than C-SCAN.

8. Comparison of Disk Scheduling Algorithms

Algorithm Seek Time Starvation Performance
FCFS High No Average
SSTF Low Possible Good
SCAN Medium No Very Good
C-SCAN Medium No Very Good
LOOK Low No Excellent
C-LOOK Very Low No Excellent
🔥 RGPV Exam Tip: Prepare FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK with numerical examples. Numerical problems from disk scheduling are commonly asked in university exams.

9. File Concepts

A File is a collection of related data stored on secondary storage such as a hard disk or SSD. Files are used to permanently store programs, documents, images, videos, databases and other information. The operating system manages files so that users can easily create, access, modify and delete data whenever required.

Definition:
A file is a named collection of related information stored on secondary storage that can be accessed and managed by the operating system.

Characteristics of a File

  • Every file has a unique name.
  • Files store related information.
  • Data is stored permanently.
  • Each file occupies disk space.
  • Files can be shared among users.

Common File Attributes

Attribute Description
File Name Unique name used to identify the file.
Extension Indicates file type (.txt, .pdf, .jpg).
Location Physical storage location on disk.
Size Total storage occupied by file.
Owner User who created the file.
Permissions Read, Write and Execute rights.
Date & Time Creation and modification details.

Basic File Operations

Create
Open
Read
Write
Rename
Close
Delete
User ↓ Operating System ↓ File System ↓ Hard Disk

10. File Manager

A File Manager is a component of the operating system responsible for managing files and directories. It acts as an interface between users and the file system by providing facilities for creating, deleting, copying, moving and organizing files.

Definition:
File Manager is the part of an operating system that controls the creation, storage, retrieval and deletion of files.

Functions of File Manager

  • Create new files and folders.
  • Delete unwanted files.
  • Copy and move files.
  • Rename files.
  • Maintain directory structure.
  • Allocate disk space.
  • Provide file protection.
  • Support file sharing.
User Request ↓ File Manager ↓ File System ↓ Disk Storage

Advantages of File Manager

  • Easy file organization.
  • Fast file searching.
  • Better disk utilization.
  • Supports security and permissions.
  • Simplifies file operations.

Disadvantages

  • Consumes system resources.
  • Large file systems become complex.
  • Improper permissions may create security risks.

11. File Organization

File Organization refers to the method used to arrange and store records inside a file. Proper organization improves data retrieval speed, storage efficiency and system performance.

★★★★★ RGPV generally asks the comparison of different file organization methods.

Types of File Organization

Type Description Best Use
Sequential File Records stored one after another. Reports & Logs
Direct File Records accessed directly using address. Databases
Indexed File Uses index for faster searching. Large Data Files
Hashed File Uses hash function to locate records. Fast Lookup

Sequential File Organization

Records are stored one after another in a fixed order. Searching is performed sequentially from the beginning.

Direct File Organization

Records are accessed directly using their address or key value without searching the entire file.

Indexed File Organization

An index table stores pointers to records. Searching becomes much faster because the operating system first searches the index.

File ↓ Index Table ↓ Required Record

Advantages of Proper File Organization

  • Faster searching.
  • Efficient storage utilization.
  • Easy maintenance.
  • Improved system performance.
  • Supports large databases.

Disadvantages

  • Indexed files require extra storage.
  • Updating indexes increases overhead.
  • Complex implementation for large systems.
💡 Exam Tip Remember the difference between Sequential, Direct and Indexed File Organization. This comparison is frequently asked in RGPV examinations.

12. File Access Methods

A file access method defines how data is read from or written to a file. The operating system provides different access methods depending on the application requirements. Choosing the correct access method improves file searching speed and overall system performance.

Definition:
A File Access Method is the technique used by the operating system to access records stored inside a file.

Types of File Access Methods

Access Method Description Best Used For
Sequential Access Records are accessed one after another in order. Text files, Logs
Direct (Random) Access Records are accessed directly using their address. Databases
Indexed Access An index is used to locate records quickly. Large Business Applications

1. Sequential Access

Sequential Access reads records from the beginning of the file until the required record is found. This method is simple but slower for large files.

Record 1 ↓ Record 2 ↓ Record 3 ↓ Record 4 ↓ Required Record

Advantages

  • Simple implementation.
  • Suitable for sequential processing.
  • Low storage overhead.

Disadvantages

  • Slow searching.
  • Not suitable for large databases.

2. Direct (Random) Access

Direct Access allows the operating system to jump directly to any record without reading previous records. It is widely used in modern database systems.

Record Number ↓ Address Calculation ↓ Direct Access ↓ Required Record

Advantages

  • Very fast searching.
  • Quick data modification.
  • Efficient for databases.

Disadvantages

  • More complex implementation.
  • Requires address calculation.

3. Indexed Access

Indexed Access maintains a separate index table that stores pointers to records. The operating system first searches the index and then accesses the required record directly.

Index Table ↓ Pointer ↓ Required Record

Advantages

  • Fast searching.
  • Efficient for large files.
  • Supports both sequential and direct access.

Disadvantages

  • Requires additional storage.
  • Index maintenance increases overhead.
★★★★★ RGPV Important Difference between Sequential, Direct and Indexed Access is one of the most frequently asked theory questions.

13. File Allocation Methods

File Allocation Method determines how disk blocks are assigned to a file. Proper allocation improves storage efficiency and file access speed.

Definition:
File Allocation Method is the technique used by the operating system to allocate disk space for storing files.

Objectives

  • Efficient disk utilization.
  • Fast file access.
  • Reduce fragmentation.
  • Easy file expansion.

Types of Allocation Methods

Method Description Performance
Contiguous Allocation File occupies continuous disk blocks. Very Fast
Linked Allocation Blocks are linked together using pointers. Medium
Indexed Allocation Separate index block stores addresses. Fast

1. Contiguous Allocation

In Contiguous Allocation, all blocks of a file are stored in consecutive memory locations.

Block 20 ↓ Block 21 ↓ Block 22 ↓ Block 23

Advantages

  • Very fast access.
  • Simple implementation.
  • Supports sequential and direct access.

Disadvantages

  • External fragmentation.
  • Difficult file expansion.

2. Linked Allocation

In Linked Allocation, each disk block contains a pointer to the next block. Blocks may be scattered anywhere on the disk.

Block 5 ↓ Pointer ↓ Block 21 ↓ Pointer ↓ Block 48

Advantages

  • No external fragmentation.
  • Easy file growth.

Disadvantages

  • Slow random access.
  • Pointer storage overhead.

3. Indexed Allocation

Indexed Allocation stores addresses of all file blocks in a separate index block. The operating system uses this index to locate data quickly.

Index Block ↓ Block 12 ↓ Block 34 ↓ Block 56 ↓ Block 89

Advantages

  • Fast random access.
  • No external fragmentation.
  • Easy file expansion.

Disadvantages

  • Extra index block required.
  • Consumes additional storage.

Comparison of Allocation Methods

Feature Contiguous Linked Indexed
Random Access Excellent Poor Excellent
Sequential Access Excellent Good Good
Fragmentation External No No
Implementation Simple Moderate Complex
Exam Importance ★★★★★ ★★★★★ ★★★★★
🔥 RGPV Exam Tip Prepare the comparison of **Contiguous, Linked and Indexed Allocation**. This question appears almost every year in 5-mark, 7-mark or 14-mark sections.

14. Free Space Management

Whenever a new file is created, the operating system must locate empty disk blocks where the file can be stored. The technique used to identify and manage these unused disk blocks is called Free Space Management. It helps improve storage efficiency and prevents wastage of disk space.

Definition:
Free Space Management is the process of keeping track of all free disk blocks so that they can be allocated whenever a new file is created.

Objectives

  • Efficient utilization of disk space.
  • Fast allocation of free blocks.
  • Reduce fragmentation.
  • Improve file storage performance.

Methods of Free Space Management

Method Description Advantage
Bit Map (Bit Vector) Each block is represented by one bit. Fast searching
Linked List Free blocks are connected using pointers. Simple implementation
Grouping One free block stores addresses of other free blocks. Efficient allocation
Counting Stores starting address and number of free blocks. Suitable for contiguous free space

Bit Map Method

1 = Free Block 0 = Occupied Block 1 1 0 0 1 0 1 1

Advantages

  • Easy implementation.
  • Fast searching.
  • Suitable for modern operating systems.

Disadvantages

  • Consumes additional memory.
  • Large disks require large bitmaps.
★★★★★ Exam Tip Bit Map and Linked List methods are frequently asked in RGPV examinations.

15. Directory Systems

A Directory is a special file that stores information about other files and folders. It helps users organize, locate and manage files efficiently.

Definition:
A Directory System is the structure used by the operating system to organize files and folders.

Functions of Directory

  • Stores file names.
  • Maintains file locations.
  • Supports searching.
  • Provides file organization.
  • Supports file sharing.
Root Directory ↓ Folder A ↓ Folder B ↓ Files

Types of Directory Structure

Directory Type Description
Single Level Directory All files stored in one directory.
Two Level Directory Separate directory for each user.
Tree Structured Directory Hierarchical organization of files.
Acyclic Graph Directory Allows shared files and folders.
General Graph Directory Supports links and cycles.

Advantages

  • Easy file organization.
  • Fast searching.
  • Supports hierarchical storage.
  • Easy backup and maintenance.

Disadvantages

  • Complex implementation for large systems.
  • Permission management becomes difficult.
★★★★★ Prepare Tree Directory and Two-Level Directory diagrams for exams.

16. File Protection

File Protection is the mechanism used by the operating system to prevent unauthorized access, modification or deletion of files. It ensures that only authorized users can perform specific operations on files.

Definition:
File Protection is the process of controlling access permissions for files and directories.

Need of File Protection

  • Prevent unauthorized access.
  • Protect confidential information.
  • Maintain data integrity.
  • Provide secure file sharing.
  • Avoid accidental deletion.

Types of File Permissions

Permission Meaning
Read (R) User can read the file.
Write (W) User can modify the file.
Execute (X) User can execute the file.
Delete User can remove the file.
User ↓ Authentication ↓ Permission Check ↓ Read / Write / Execute ↓ Access Granted or Denied

Protection Mechanisms

  • Password Protection.
  • Access Control List (ACL).
  • File Ownership.
  • User Groups.
  • Permission Bits.
  • Encryption.

Advantages

  • Improves system security.
  • Protects sensitive information.
  • Supports secure file sharing.
  • Prevents unauthorized modification.

Disadvantages

  • Improper permissions may block valid users.
  • Complex management in large systems.
🔥 Most Expected Question Explain File Protection with file permissions (Read, Write and Execute).

17. File Organization & Access Mechanism

File Organization defines how records are physically stored inside a file, whereas the File Access Mechanism describes how these records are retrieved and modified by the operating system. A proper combination of organization and access method improves storage efficiency and system performance.

Definition:
File Organization & Access Mechanism is the method used by the operating system to store, locate and retrieve file data efficiently.

Working Process

Create File
Store Records
Organize Records
Select Access Method
Retrieve Data
Update File
Application ↓ Operating System ↓ File System ↓ Disk Blocks ↓ Required Data

Advantages

  • Fast data retrieval.
  • Better storage utilization.
  • Easy modification of records.
  • Improved system performance.

18. File Sharing Implementation Issues

Modern operating systems allow multiple users to access the same file simultaneously. While file sharing improves collaboration, it also creates synchronization, consistency and security challenges.

★★★★★ Frequently Asked Theory Question

Major File Sharing Issues

  • Concurrent access by multiple users.
  • Data inconsistency.
  • Race condition.
  • Permission conflicts.
  • Deadlock while accessing shared files.
  • Security risks.
Problem Solution
Simultaneous Write File Locking
Unauthorized Access User Permissions
Data Corruption Synchronization
Duplicate Modification Version Control
User A ↓ Shared File ↑ User B ↓ Operating System Controls Access

Advantages of File Sharing

  • Easy collaboration.
  • Improves productivity.
  • Reduces duplicate files.
  • Supports network environments.

Disadvantages

  • Security threats.
  • Synchronization issues.
  • Access conflicts.

19. File Management in Linux

Linux follows a hierarchical file system where every file and directory starts from the Root Directory (/). Everything in Linux is treated as a file, including devices and hardware resources.

/ ↓ home ↓ user ↓ Documents ↓ Files

Important Linux Directories

Directory Purpose
/ Root Directory
/home User Files
/bin Essential Commands
/etc Configuration Files
/tmp Temporary Files
/usr User Applications
/var Log Files

Common Linux File Commands

Command Purpose
pwd Show Current Directory
ls List Files
cd Change Directory
mkdir Create Directory
cp Copy File
mv Move/Rename File
rm Delete File
cat Display File Contents
Remember Linux commands because they are frequently asked as short notes and viva questions.

20. Introduction to Distributed Systems

A Distributed System is a collection of multiple independent computers connected through a network that work together as a single system. Users experience the system as one computer even though processing is performed by multiple machines.

Definition:
A Distributed System is a network of interconnected computers that cooperate to achieve a common goal.
Computer A ↔ Computer B ↔ Computer C ↓ Shared Resources

Characteristics

  • Resource Sharing.
  • Transparency.
  • Scalability.
  • Fault Tolerance.
  • High Availability.

Advantages

  • Fast processing.
  • High reliability.
  • Easy resource sharing.
  • Better scalability.
  • Cost effective.

Disadvantages

  • Complex design.
  • Network dependency.
  • Security challenges.
  • Difficult synchronization.
Centralized System Distributed System
Single Computer Multiple Computers
Less Reliable More Reliable
Limited Resources Shared Resources
Low Scalability High Scalability
🔥 RGPV Important Prepare the comparison between Centralized System and Distributed System. It is a highly repeated exam question.

📊 Unit 5 PYQ Analysis

Unit 5 is very important because disk scheduling numericals and file management theory questions are frequently asked in RGPV exams.

TopicQuestion TypeImportance
Disk SchedulingNumerical★★★★★
File Allocation MethodsTheory / Comparison★★★★★
Directory SystemsTheory / Diagram★★★★☆
File ProtectionShort / Theory★★★★☆
Linux File ManagementShort Notes★★★☆☆
Distributed SystemsTheory★★★☆☆
🔥 Most Expected Question: Explain disk scheduling algorithms with example.

⭐ Important Exam Questions

  1. Explain disk scheduling and its objectives.
  2. Explain FCFS, SSTF, SCAN and C-SCAN disk scheduling.
  3. Compare LOOK and C-LOOK algorithms.
  4. Explain file concepts and file attributes.
  5. Explain functions of File Manager.
  6. Explain Sequential, Direct and Indexed access methods.
  7. Explain Contiguous, Linked and Indexed allocation methods.
  8. Explain Free Space Management methods.
  9. Explain Directory Systems with types.
  10. Explain File Protection and file permissions.
  11. Explain File Management in Linux.
  12. Explain Distributed Systems with advantages and disadvantages.

🎤 Viva Questions

  • What is disk scheduling?
  • What is seek time?
  • What is file?
  • What is file manager?
  • What is sequential access?
  • What is indexed allocation?
  • What is free space management?
  • What is directory system?
  • What is file protection?
  • What is distributed system?

⚡ Quick Revision Sheet

TopicRemember
Disk SchedulingDecides order of disk I/O requests.
FCFSRequests served in arrival order.
SSTFNearest request served first.
SCANDisk head moves like elevator.
File ManagerManages files and folders.
Contiguous AllocationFile stored in continuous blocks.
Linked AllocationBlocks connected using pointers.
Indexed AllocationIndex block stores block addresses.
Linux File SystemEverything is treated as a file.
Distributed SystemMultiple computers work as one system.

❓ Frequently Asked Questions

Is Unit 5 important for RGPV exams?

Yes. Unit 5 is important because disk scheduling numericals and file management theory questions are commonly asked.

Which topic is most important in Unit 5?

Disk Scheduling, File Allocation Methods, Directory Systems and File Protection are the most important topics.

Can numerical questions come from Unit 5?

Yes. Disk scheduling algorithms like FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK can come as numerical questions.

📚 Related Operating System Units