Simple definition
An inode is a metadata structure used by Unix-like filesystems to describe a file or directory.
Technical definition
An inode stores or references information such as file type, permissions, owner UID/GID, size, timestamps, link count, and data-location information depending on the filesystem. The filename is not stored in the inode: a directory entry maps a name to an inode number. Multiple names can therefore reference the same inode through hard links.
What is it used for?
Allow the filesystem to identify objects and maintain their metadata independently of the names used in directories.
Practical example
A filesystem can still have several gigabytes free but refuse to create new files if all available inodes are exhausted. df -i shows inode usage, while stat displays metadata for a file.
Common issues
- Inode exhaustion caused by millions of small files
- Confusing free disk space with available inodes
- Removing one filename while another hard link still references the inode
- Checking only
df -hand forgettingdf -i
Key takeaway: An inode describes the file but not its filename; the directory entry stores the name and points to the inode number.