Linux and Unix systems use inode numbers, instead of file names, to identify files. In other words, files names are simply aliases of inode numbers used for the convenience of identification. When you open a file, the process involved in the system is as follows:
- The system locates the inode number that corresponds to the file name.
- The system retrieves inode information using this inode number.
- The system locates the block where the file data is stored based on the inode information, and then reads the data.
Because every file must have an inode, a potential issue is that all of the inodes of a hard disk may be already used even before this disk is not completely full. In such case, it is not possible to create a new file on the hard disk. Therefore, the purpose of the inode usage metric is to monitor inode usage to manage and avoid issues like the preceding one.
- To view the total number of inodes for each hard disk partition and the number already used, you can use
- To view the size of each inode node, you can use
sudo dumpe2fs -h /dev/hda | grep "Inode size".