File System
- In Turkish
- Dosya Sistemi
In short
A file system is the part of an operating system that organizes data on a storage device into files and folders and tracks where each piece is stored.
What is a file system?
A file system is the set of rules and data structures an operating system uses to store, name, and find data on a hard drive, SSD, USB stick, or network share. Without one, a storage device would just be a huge sequence of raw blocks with no way to tell where one file ends and the next begins.
Most file systems split storage into fixed-size blocks and keep metadata that records each file's name, size, permissions, timestamps, and which blocks hold its contents. On Unix-like systems this metadata lives in a structure called an inode, and directories map file names to inodes. Many modern file systems use journaling, which writes planned changes to a log first so the file system can recover cleanly after a crash or power loss.
A file system works like a library catalog. The books are spread across many shelves, but the catalog tells you each book's title, location, and who may borrow it. Common examples include ext4 and Btrfs on Linux, NTFS on Windows, APFS on Apple devices, and FAT32 or exFAT on removable drives.
A file system is sometimes confused with a database or with the folder window in a file manager. A database adds structured queries, indexes, and transactions on top of stored data, while a file system mainly stores and retrieves whole files. The folder window you see is just a program that displays the file system's directory tree.
Key takeaways
- A file system organizes raw storage into named files and directories.
- Metadata tracks each file's size, permissions, timestamps, and data blocks.
- Journaling helps a file system recover after crashes or power loss.
- Different operating systems use different file systems, such as ext4, NTFS, and APFS.
- Programs access files through system calls such as
open,read, andwrite.
Example
# Show mounted file systems, their types, and free space
df -hT
# Show a file's metadata: size, permissions, inode, timestamps
stat notes.txt
# Show inode numbers next to file names
ls -liReaders ask
What is an inode?
An inode is a data structure on Unix-like file systems that stores a file's metadata, such as its size, owner, permissions, and the locations of its data blocks. The file name itself is stored in the directory, which points to the inode.
What does it mean to mount a file system?
Mounting attaches a file system to a directory in the existing directory tree so its files become accessible. For example, a USB drive might be mounted at /media/usb on Linux.
What is the difference between FAT32 and exFAT?
Both are simple file systems that work across most operating systems, which makes them popular for USB drives and memory cards. FAT32 limits a single file to 4 GB, while exFAT removes that limit.
See also
- KernelOperating Systems, p. 17A kernel is the core part of an operating system that manages the CPU, memory, and hardware devices and controls how programs get access to those resources.
- System CallOperating Systems, p. 31A system call is a request from a program to the operating system kernel to perform a privileged action, such as reading a file or starting a process.
- LinuxDevOps & Cloud, p. 33Linux is an open-source operating system kernel that powers most servers, cloud platforms, containers, and Android phones, usually packaged as a distribution.
- ShellOperating Systems, p. 27A shell is a program that reads commands typed by a user or written in a script and asks the operating system to run them, usually through a text interface.
- DatabaseDatabases, p. 6A database is an organized collection of data stored on a computer, managed by software that lets applications save, search, and update it efficiently.
Spotted a mistake or something missing on this page?Suggest an edit