Saturday 15 April 2017

Inode number

Inode
Each file is associated with an inode, which is identified by an integer number, often referred to as an i-number or inode number.
When we try to access the file then we uses the file name to do so but internally the file-name is first mapped with its Inode number stored in a table. Then through that Inode number the corresponding Inode is accessed. Inode table is a table where mapping of Inode numbers is provided. Inodes store information about files and directories, such as 


Stat command is used to display file statistics that also displays inode number of a file.

Syntax
stat [file_name]

ls command with options i list file and directory with inode number.
Syntax
ls -i [file_name]

Limitaions
The maximum number of inodes is fixed at file system creation, limiting the maximum number of files the file system can hold. A situation can arise when all the Inodes are consumed. Where we have free storage space but still we cannot create any new file. This may occur due to creation of huge number of very small sized files. This will consume all the Inodes. There exists an algorithm which is used to create number of Inodes in a file system. This algorithm takes into consideration the size of the file system and average file size. The user can modify the number of Inodes while creating the file system.

No comments:

Post a Comment