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 Operations | File Attributes |
1. Creation | 1. Name |
2. Reading | 2. Extension(type) |
3. Writing | 3. Identifier |
4. Deletion | 4. Location |
5. Truncating | 5. Size |
6. Repositioning | 6. Modified Date, Created Date |
7. Protection/Permission | |
8. Encryption, Compression |
File Allocation Methods
- Contiguous Allocation
- Non-Contiguous Allocation - Linked List Allocation, Indexed Allocation These methods aim for efficient disk utilization and faster access times.
Contiguous File Allocation
Advantages
- Easy to implement.
- Excellent read performance.
Disadvantages
- Disk will become fragmented.
- Difficult to grow file.
Linked List File Allocation
Advantages
- No external fragmentation.
- File size can increase.
Disadvantages
- Large seek time.
- Random acess/Direct acess difficult.
- Overhead of Pointers.
Indexed File Allocation
Advantages
- Supports direct access.
- No external fragmentation.
Disadvantages
- Pointer overhead(high number of pointers used).
- 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