I know that the filename is stored in directories and not in inode. Kindly tell me where the inode number of a file is stored? Is it stored in the directory file?
Inode Structure image is provided below:
See from the above image. The contents of directory contains inode numbers. Each inode is the index to the inode table. The inode table is stored in the logic disk block. Each entry of inode table stores some file attributes, such as file size, permission, ownership, disk block address, time of last modification etc.
Both directories and ordinary (non-directory) files are files. This definition could be found on Chapter 4, "Modern Operating system", Prof. Andrew S. Tanenbaum.
Further information on inodes can be found here:
According to me, INODE will also use a very tiny portion of disk space (1 or 2 sectors), depends on the size of a file information it holds. In Linux, Inodes will be created when we create the filesystem itself. During that time, a small portion of disk space will be taken for Inodes.