UNIT – 4 NOTES
FILE SYSTEM AND DISK SCHEDULING
Prepared for First Year BCA Students
Easy to Understand • Examination Oriented • Detailed Notes
1. Introduction to File System
A File System is a method used by the operating system to store, organize, manage,
and retrieve files from storage devices like hard disks, SSDs, pen drives, etc.
Without a file system:
• Data would be stored randomly
• Users could not manage files easily
• The OS would not know where data is stored
Examples: FAT32, NTFS, ext4, APFS
2. File Concepts
A file is a collection of related information stored permanently on secondary storage
devices.
Examples:
• Text files
• Images
• Videos
• Program files
3. File Attributes
File attributes are properties associated with a file.
Important Attributes:
• Name
• Identifier
• Type
• Size
• Location
• Protection
• Date and Time
• Owner
4. File Operations
Common operations performed on files:
• Create
• Open
• Read
• Write
• Append
• Close
• Delete
• Rename
• Copy
5. Types of Files
1. Program Files – contain instructions for execution
2. Data Files – contain user data
3. Text Files – store data in readable form
4. Binary Files – store data in binary format
6. File Access Methods
Sequential Access:
• Data accessed one after another
• Simple but slower
Direct Access:
• Any record accessed directly
• Faster and used in disks
Indexed Access:
• Uses an index table for fast searching
7. Directory Structure
A directory is a container used to organize files.
Types:
• Single-Level Directory
• Two-Level Directory
• Tree Structure Directory
• Acyclic Graph Directory
8. File Protection
Protection prevents unauthorized access.
Permissions:
• Read (R)
• Write (W)
• Execute (X)
Methods:
• Password Protection
• Access Control List
• Encryption
9. Consistency Semantics
Defines how file changes are visible to users.
Types:
• UNIX Semantics
• Session Semantics
• Immutable Files
10. File System Implementation
File system implementation describes how files are internally managed.
Components:
• Boot Control Block
• Super Block
• Directory Structure
• File Control Block (FCB)
11. File Allocation Methods
Contiguous Allocation:
• Continuous blocks
• Fast but causes fragmentation
Linked Allocation:
• Blocks linked together
• No fragmentation but slower random access
Indexed Allocation:
• Uses index block
• Direct access possible
12. Free Space Management
Methods used to track free disk blocks:
• Bit Vector Method
• Linked List Method
• Grouping Method
• Counting Method
13. Disk Structure
Components of Disk:
• Platter
• Track
• Sector
• Cylinder
14. Disk Scheduling
Disk scheduling determines the order of servicing disk requests.
Need:
• Reduce seek time
• Improve performance
• Increase efficiency
15. FCFS Algorithm
First Come First Serve services requests in arrival order.
Advantages:
• Simple
• Fair
Disadvantages:
• High seek time
16. SSTF Algorithm
Shortest Seek Time First services the nearest request first.
Advantages:
• Better performance
Disadvantages:
• Starvation possible
17. SCAN Algorithm
Disk head moves in one direction servicing requests and then reverses.
Also called Elevator Algorithm.
Advantages:
• Efficient
• Less starvation
18. Comparison of Algorithms
FCFS:
• Simple but slow
SSTF:
• Faster but starvation possible
SCAN:
• Efficient and balanced
19. Important Examination Questions
Short Questions:
1. Define file system.
2. What are file attributes?
3. Define seek time.
4. Explain contiguous allocation.
Long Questions:
1. Explain file allocation methods.
2. Discuss disk scheduling algorithms.
3. Explain directory structures with diagrams.
20. Quick Revision
• File = Collection of data
• Directory = Organizes files
• Sequential Access = One by one access
• Contiguous Allocation = Continuous blocks
• FCFS = First Come First Serve
• SSTF = Nearest request first
• SCAN = Elevator movement
Examination Tips
• Draw diagrams wherever possible.
• Mention advantages and disadvantages in separate points.
• Write definitions clearly.
• Practice disk scheduling numericals regularly.
• Revise quick notes before examination.
Conclusion
The file system is one of the most important parts of an operating system. It helps in
storing, organizing, and managing files efficiently. Understanding disk scheduling
and file allocation methods improves knowledge about storage management and
operating system performance.