Inode

The inodes (contraction of “index” and “node”; in French, node of index ) is Structures of data containing the information relating to the file S stored in some filesystems (in particular of type Linux/Unix). To each file a number of inode ( i-number ) in the filesystem corresponds in which it resides, single with the peripheral on which it is located. The inodes can, according to the Filesystem, to also contain information concerning the file, such as its creator (or owner), his type of access (for example under Unix: reading, writing and execution), etc

Importance of the inodes

The inodes contain in particular the Métadonnées Filesystems, and in particular those concerning the Rights of access.

The inodes are created during the creation of the Filesystem. The quantity of inodes (generally given during the formatting and depend on the size on the partition) indicates the maximum number of files that the Filesystem can contain.

Technical precise details

Inode and peripheral

The number of inode is a single entirety for the peripheral in which it is stored. The number of inode of a file toto can be posted with the order

ls - I toto

The term inode usually refers to the inodes in the peripherals block (see) which manage regular files, repertories and possibly of the bonds symbolic system. This concept is particularly important to succeed in repairing a damaged Filesystem (see Fsck).

Specifications POSIX on the attributes of files

The standard POSIX was based on the traditional filesystems of Unix. This standard thus imposes that the regular files have the attribute S following:

  • size of the file in Byte S

  • Identifying peripheral containing the file
  • the identifier of the owner of the file
  • the identifier of the group to which the file
  • belongs the number of inode which identifies the file in the filing system
  • the mode of the file which determines which user can read, write and carry out this file
  • time-stamping (timestamp) for
    • the date of last modification ctime of the inode (posted by the order stat or ls - LLC )
    • the date of last modification of the file mtime (posted by traditional the ls - L )
    • the date of last access atime (posted by the order stat or ls - read )
  • a meter indicating the number of physical bonds on this inode.

Note: the inodes do not contain the file names.

See.

Various versions of Inode

vnode of Berkeley

The representation in memory of the inodes in the core is called struct inode in Linux. The systems derived from BSD (Berkeley) use a structure called vnod (v meaning virtual here).

Inode in ReiserFS

The nontraditional Unix filesystems such that ReiserFS avoids having a table of the inode of fixed size, they use a more flexible structure to manage the inodes.

Example of use: the format Ext2, formerly usually used by the systems GNU /Linux

Each inode contains approximately 64 fields , of which 13 of them contain blocks being able to be of two types:

  • Of the blocks of addresses, which contain pointers towards other blocks;

  • Of the storage blocks, which contain the data of the file.

The first 10 fields (on the 13) contain the addresses of the first 10 storage blocks of the file (at a rate of an address per block). If the blocks on which the first 10 fields point are sufficient to contain the file, fields 11,12 and 13 are not used.

In the contrary case, in addition to the first 10 blocks, blocks 11,12 and 13 are used. These blocks function according to a system of indirection. There exist three levels of indirection:

  • the simple indirection, used by field 11;

  • the double indirection, used by field 12;
  • triples It indirection, used by the field 13.

The higher the level of indirection is, the more the final number of storage blocks on which point the field (11, 12 or 13) will be high. This system thus makes it possible the files to have a considerable size.

In a concrete way, each one of these three fields points towards a block of addresses, which will be able to point towards one or more blocks of addresses or data. By supposing that the blocks have like cuts 1024 bytes (1 KB), and that each address (in the case of a block of addresses) is stored on 32 bits (4 bytes), each block of addresses will contain 256 of them. With this information in hand, it is possible to calculate the maximum size of a file.

To be stored on disc, a large file which cannot be contained in 10 storage blocks will have to use fields 11,12 and 13.

Field 11 points towards a block of addresses. This block of addresses contains pointers towards storage blocks (256 pointers). It is the simple indirection If that is sufficient to contain the file, by counting the blocks pointed by the first 10 fields, fields 12 and 13 are not used.

If not, the system will call upon double indirection (block 12). This block points, like field 11, towards a block of addresses. However, this block of addresses does not point towards 256 storage blocks; it points towards 256 other blocks of addresses. They are these 256 blocks of addresses which will point towards 256 storage blocks. If these storage blocks are not sufficient to contain the file in its entirety, the 13 field should be used.

The 13th field is with triple indirection . That means that the field him even point towards block of 256 addresses (as for blocks 11 and 12). These 256 pointers point each one on a block of 256 addresses, like field 12. However, these new blocks of addresses point not on storage blocks, but on other blocks of addresses (still 256), which them, point towards 256 storage blocks.

By using the assumptions defined higher concerning the size of a block and an address, it is then simple to calculate the maximum size of a file in a filing system EXT2.

It is initially necessary to determine on how much storage blocks on the whole the system of indirections will point:

  • the first 10 fields point each one on 1 storage block;

  • field 11 (simple indirection) point towards 256 storage blocks;
  • field 12 (double indirection) point towards 256 storage blocks;
  • the field 13 (triple indirection) point towards 256 storage blocks.

The maximum size of a file can then be calculated by multiplying by 1024 bytes the number of storage blocks total:

1024 * (10 + 256^1 + 256^2 + 256^3) = 17.247.250 432

The maximum size of a file with the filing system EXT2 (by considering the assumptions above as for the size of the blocks) is of 17.247.250 432 bytes, that is to say approximately 17 Go.

Random links:American International Group | Saint-Martin-of-Beauville | September 6th in the railroads | Chetiflor | Noble Jamy | 652