File System In Operating Systems

Operating Systems Part 10

ยท

3 min read

File System In Operating Systems

File System In Operating System

File system manages how data is to be stored or fetched. Files are logically divided into blocks and these blocks are then mapped onto the sectors in a hard disk. This mapping may or may not be contiguous.

File Attributes & Operations

File OperationsFile Attributes
1. Creation1. Name
2. Reading2. Extension(type)
3. Writing3. Identifier
4. Deletion4. Location
5. Truncating5. Size
6. Repositioning6. Modified Date, Created Date
7. Protection/Permission
8. Encryption, Compression

File Allocation Methods

  1. Contiguous Allocation
  2. Non-Contiguous Allocation - Linked List Allocation, Indexed Allocation These methods aim for efficient disk utilization and faster access times.

Contiguous File Allocation

Advantages

  1. Easy to implement.
  2. Excellent read performance.

Disadvantages

  1. Disk will become fragmented.
  2. Difficult to grow file.

Linked List File Allocation

Advantages

  1. No external fragmentation.
  2. File size can increase.

Disadvantages

  1. Large seek time.
  2. Random acess/Direct acess difficult.
  3. Overhead of Pointers.

Indexed File Allocation

Advantages

  1. Supports direct access.
  2. No external fragmentation.

Disadvantages

  1. Pointer overhead(high number of pointers used).
  2. Multilevel Index(for very large files).

Unix Inode Structure

Unix Inode is a data structure that contains File attributes, direct blocks, single indirect blocks, double indirect blocks and triple indirect blocks. It is a hybrid approach that overcomes the shortcomings of the previous file allocation methods. 'I' is Index, 'Node' is the block in Inode.

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

ย