Concept of the i-Nodes and Superblocks in Linux/Unix System

The fundamental building block of  UNIX file systems (including Linux’s ext2/ext3) is the i-node. An i-node is a control structure that points either to the other i-nodes or to data blocks.

The control information in the i-node includes the file’s owner, permissions, size, time of last access, creation time, group ID, etc. ( the entire kernel data structure is available in /usr/src/linux/include/linux/ext3_fs.h—assuming, of course, that you have the source tree installed in the /usr/src directory.) The one thing that an i-node doesn"t  keep is the file’s name.

While the directories themselves are special instances of  the files. And this means that each directory gets an i-node, and further the i-node points to data blocks containing information (filenames and i-nodes) about the files in the directory. The i-nodes are used to provide the  indirection so that more data blocks can be pointed to—which is reason why each i-node does not
contains the filename. (Only one i-node works as a representative for the entire file which contains the filename; thus it would be a waste of the space if every i-node contains the  filename information.) Each indirect block can be used to point in turn to other indirect blocks if necessary.

Superblocks:-
The very first information which is read from a disk is its superblock. This small data structure reveals the several key pieces of the information, which includes the disk’s geometry, the amount of available space, and, most important of the all, the location of the first i-node. In the absence of a superblock, a file system is useless.

Something as important as the superblock cannot be left to the chance. Thus the Multiple copies of this data structure are scattered all over the disk to provide backup in case the one is damaged. Under the Linux’s ext2 file system, a superblock is placed after every group of blocks, which contains an i-nodes and data. One group consists of 8,192 blocks; thus this means the first redundant superblock is at 8193, the second at 16385, and so on.

Comments

0 Responses to "Concept of the i-Nodes and Superblocks in Linux/Unix System"

Post a Comment

 

Managing Shell And its Secrets

Subscribe To Get Update On Mobile

Subscribe
Get updates of latest post on your mobile free