A File System is the component of the OS responsible for managing how data is stored on and retrieved from storage devices (hard drives, SSDs). It provides an abstraction layer so users and applications deal with named files and directories instead of raw disk sectors.
Every file has metadata associated with it:
rwxr-xr-x).Directories organize files into a hierarchical namespace.
All files in one directory. Simple but impossible to manage with many files. Name conflicts are inevitable.
Each user gets their own directory. Solves naming conflicts between users but not within a user's files.
Directories form a tree. Each directory can contain files and subdirectories. This is what Linux (/home/user/Documents/) and Windows (C:\Users\Documents\) use.
/home/user/file.txt)../file.txt).Allows shared subdirectories and files (hard links, symbolic links). A file can be accessed from multiple directory paths. Deletion is complex (reference counting or back-pointers needed).
A Journaling File System maintains a log (journal) of changes that are going to be made before they are actually written to the main file system. If the system crashes during a write, the journal can be replayed to bring the file system to a consistent state, avoiding corruption and eliminating the need for a full fsck scan.