File System
A file system is a method and data structure that an operating system uses to control how data is stored and retrieved.
Types: 1. Disk (NTFS, ext4). 2. Flash (F2FS). 3. Database-based. 4. Network (NFS, SMB). 5. Shared-disk. Operations: Create, Open, Read, Write, Delete, Truncate.
graph LR
Center["File System"]:::main
Rel_off_chain_computation["off-chain-computation"]:::related -.-> Center
click Rel_off_chain_computation "/terms/off-chain-computation"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
Imagine you have a giant toy chest with thousands of tiny LEGO bricks. If you just dump them all in, you'll never find the one piece you need. A file system is like putting all the blue bricks in one box, the red ones in another, and putting a label on each box. It's the system that keeps your digital 'toys' organized and easy to find.
🤓 Expert Deep Dive
Technically, file systems work by dividing the physical disk into 'Blocks' or 'Clusters'. In Unix-like systems, every file is represented by an 'Inode', which contains metadata and pointers to the actual data blocks. Modern file systems like NTFS (Windows), ext4 (Linux), and APFS (Apple) use 'Journaling'—a log of changes that have not yet been committed to the main file structure. This ensures that if the computer crashes, the file system can 'replay' the journal to avoid corruption. Another important feature is 'Access Control' (ACLs), which defines fine-grained permissions for specific users or groups. High-end file systems like ZFS or Btrfs also include 'Copy-on-Write' and 'Data Deduplication' features to save space and improve reliability.