File System
A method and data structure used by operating systems to organize, store, retrieve, and manage files and directories on storage devices.
Also known as: Filesystem, FS
Category: Software Development
Tags: software-engineering, tools
Explanation
A file system is a method and data structure that an operating system uses to organize, store, retrieve, and manage data on storage devices such as hard drives, SSDs, and USB drives. It provides the logical structure that allows users and programs to create, read, update, and delete files and directories in a predictable way.
File systems define how data is stored on disk and how metadata (file names, sizes, permissions, timestamps) is tracked. They organize data into a hierarchical tree structure of directories (also called folders) and files. In Unix-like systems, this hierarchy starts at the root directory `/`, while Windows uses drive letters like `C:\` as root nodes.
Common file system types include ext4 (the default Linux file system), NTFS (Windows), APFS (macOS), XFS (high-performance Linux), Btrfs (copy-on-write Linux file system), FAT32 and exFAT (cross-platform portable storage), and ZFS (advanced with built-in volume management and checksumming).
File systems provide several critical features: naming (assigning human-readable names to data), organization (grouping files into directories), access control (permissions determining who can read, write, or execute files), metadata management (tracking timestamps, ownership, and attributes), space management (allocating and freeing storage blocks), and journaling (recording changes to recover from crashes).
The Unix philosophy of 'everything is a file' extends the file system metaphor to devices, processes, and network connections. Device files in `/dev`, process information in `/proc`, and system information in `/sys` all use the file system interface, creating a uniform way to interact with diverse system resources.
Virtual file systems (VFS) provide an abstraction layer that allows operating systems to support multiple file system types simultaneously. Network file systems like NFS and SMB/CIFS extend file access across networks, while distributed file systems like HDFS and GlusterFS spread data across multiple machines for scalability and redundancy.
Related Concepts
← Back to all concepts