Go to the previous, next section.
An inode uniquely describes a file. Here's what an inode looks like on disk:
struct ext2_inode { unsigned short i_mode; unsigned short i_uid; unsigned long i_size; unsigned long i_atime; unsigned long i_ctime; unsigned long i_mtime; unsigned long i_dtime; unsigned short i_gid; unsigned short i_links_count; unsigned long i_blocks; unsigned long i_flags; unsigned long i_reserved1; unsigned long i_block[EXT2_N_BLOCKS]; unsigned long i_version; unsigned long i_file_acl; unsigned long i_dir_acl; unsigned long i_faddr; unsigned char i_frag; unsigned char i_fsize; unsigned short i_pad1; unsigned long i_reserved2[2]; };
i_mode
i_uid
i_size
i_atime
i_ctime
i_mtime
i_dtime
i_gid
i_links_count
i_blocks
i_flags
i_reserved1
i_block
i_version
i_file_acl
i_dir_acl
i_faddr
i_frag
i_size
i_pad1
i_reserved2
As you can see, the inode contains, EXT2_N_BLOCKS
(15 in ext2fs
0.5) pointers to block. Of theses pointers, the first
EXT2_NDIR_BLOCKS
(12) are direct pointers to data. The following entry
points to a block of pointers to data (indirect). The following entry
points to a block of pointers to blocks of pointers to data (double
indirection). The following entry points to a block of pointers to a
block of pointers to a block of pointers to data (triple indirection).
The inode flags may take one or more of the following or'ed values:
EXT2_SECRM_FL 0x0001
EXT2_UNRM_FL 0x0002
EXT2_COMPR_FL 0x0004
EXT2_SYNC_FL 0x0008
Some inodes have a special meaning:
EXT2_BAD_INO 1
EXT2_ROOT_INO 2
EXT2_ACL_IDX_INO 3
EXT2_ACL_DATA_INO 4
EXT2_BOOT_LOADER_INO 5
EXT2_UNDEL_DIR_INO 6
EXT2_FIRST_INO 11
Go to the previous, next section.