File systems iconFile Systems
Data BlocksN blocksInode TableN blocksInodeBitmap1 blockBlockBitmap1 blockBlock GroupDescriptorN blocksSuperBlock1 block

Inode Table

The inode table is used to keep track of every directory, regular file, symbolic link, or special file; their location, size, type and access rights are all stored in inodes. There is no filename stored in the inode itself, names are contained in directory files only

There is one inode table per block group and it can be located by reading the bg_inode_table in its associated group descriptor. There are s_inodes_per_group inodes per table.

Each inode contain the information about a single physical file on the system. A file can be a directory, a socket, a buffer, character or block device, symbolic link or a regular file. So an inode can be seen as a block of information related to an entity, describing its location on disk, its size and its owner. An inode looks like this:

Offset (bytes)Size (bytes)Description
02i_mode
22i_uid
44i_size
84i_atime
124i_ctime
164i_mtime
204i_dtime
242i_gid
262i_links_count
284i_blocks
324i_flags
364i_osd1
4015 * 4i_block
1004i_generation
1044i_file_acl
1084i_dir_acl
1124i_faddr
11612i_osd2

i_mode

Offset: 0 bytes
Size: 2 bytes

16bit value used to indicate the format of the described file and the access rights. Here are the possible values, which can be combined in various ways:

Offset (bytes)Size (bytes)Description
EXT2_S_IFSOCK0xc000socket
EXT2_S_IFLNK0xa000symbolic link
EXT2_S_IFREG0x8000regular file
EXT2_S_IFBLK0x6000block device
EXT2_S_IFDIR0x4000directory
EXT2_S_IFCHR0x2000character device
EXT2_S_IFIFO0x1000fifo
EXT2_S_ISUID0x0800Set process User ID
EXT2_S_ISGID0x0400Set process Group ID
EXT2_S_ISVTX0x0200sticky bit
EXT2_S_IRUSR0x0100user read
EXT2_S_IWUSR0x0080user write
EXT2_S_IXUSR0x0040user execute
EXT2_S_IRGRP0x0020group read
EXT2_S_IWGRP0x0010group write
EXT2_S_IXGRP0x0008group execute
EXT2_S_IROTH0x0004others read
EXT2_S_IWOTH0x0002others write
EXT2_S_IXOTH0x0001others execute
Offset (bytes)Size (bytes)Description
EXT2_BAD_INO1bad blocks inode
EXT2_ROOT_INO2root directory inode
EXT2_ACL_IDX_INO3ACL index inode (deprecated?)
EXT2_ACL_DATA_INO4ACL data inode (deprecated?)
EXT2_BOOT_LOADER_INO5boot loader inode
EXT2_UNDEL_DIR_INO6undelete directory inode