dEEpEst
☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
- Joined
- Mar 29, 2018
- Messages
- 13,860
- Solutions
- 4
- Reputation
- 27
- Reaction score
- 45,546
- Points
- 1,813
- Credits
- 55,090
7 Years of Service
56%

If you work with Linux or administer servers, understanding inodes is a must. Without it, you won’t understand how the file system works.

Metadata (information about the file) is stored in the inode. What it contains:
-

-

-

-

-

- 🛠 Mtime — last data modification time
-

-

-

-

-


They are written in the directory structure. In normal cases — linearly, so searching can be slow.


This is a structure that links a file name to an inode inside a directory.

-

-

🛠 Ext vs XFS: how are inodes created?
- Ext — a fixed number of inodes when formatting. Run out? Just reformat.
- XFS — inodes are created as needed. Much more flexible.
🗑 Deleting a file
Calling <code>unlink()</code> simply removes the entry from the directory and marks the inode as free.


- Hard link

- Symbolic link


This is the metadata of the file system itself. There are usually several of them (in case of corruption). What is stored there:
- Total FS size
- Block size
- Number of free/occupied blocks
- Where is the inode table
- Disk block map

Code:
dumpe2fs /dev/mount | grep -i superblock