DevOps in Linux — File System
How does Linux File system work?
Published in
7 min readJan 18, 2023
Like Linux CPU and memory, the management of disks and file systems is also the core function of the OS.
- Disk provides the most basic persistent storage for the system.
- The file system provides a tree-like structure for managing files on the disk.
Inodes and Directory Entries
The file system itself is a mechanism for organizing and managing files on a storage device. The most important thing to remember is that in Linux everything is a file. Not only ordinary files and directories, but also block devices, sockets, pipes, etc., all must be managed through a unified file system.
To facilitate file management, the Linux file system allocates two data structures for each file, an index node and a directory entry. They are mainly used to record the meta information and directory structure of the file.
- Inode: It is used to record the metadata of the file, such as the inode number, file size, access rights, modification date, data location, etc. One file has one associated inode, and like file content, inode stores on disk.
- Directory entry: Referred to as dentry for short, is used to record the name of the file, the inode pointer, and the association…