
Introduction
In UNIX operating systems, an inode is a data structure that stores important information about files in a file system. When a file system is formed in UNIX, a certain number of inodes are also created. The inode table typically takes up roughly 1% of the entire file system disc space. Sometimes, people interchange the words inode and inumber. The terms are similar and correlate, but they do not refer to the same item. The term inode refers to the data structure; the inumber is the inode's identification number. The inumber is merely one significant piece of data in a file.
Also read, Multiprogramming vs Multitasking And Open Source Operating System
Inode
In a Unix-style file system, an inode (index node) is a data structure that refers to a file-system object such as a file or directory. Each inode maintains the object's data properties and disc block addresses. Metadata (times of last change, access, and modification), as well as owner and permission info, can be found in file-system object attributes.
A directory is a collection of inodes with their assigned names. The list comprises entries for itself, its parent, and each of its children.
A file is assigned a name and an inode number, a unique integer within the file system when created. The file names and inode numbers are saved as entries in the directory that appears to the user to contain the files. In other words, the directory connects file names to inodes.
When a user or a program refers to a file by name, the Operating System looks up the matching inode, which allows the system to gather the information it requires about the file to execute subsequent activities.
In other words, a file name is simply an entry in a table of inode numbers in a Unix-like operating system rather than being directly associated with a file. The inode numbers and their associated inodes are recorded in inode tables, strategically placed throughout a file system, especially near the beginning.
The concept of inodes is very significant for recovering damaged file systems. When bits of an inode is lost, they appear in the lost+found directory of the partition where they were previously located.
Also read, Process Control Block in OS