Home

inode

An inode, short for index node, is a data structure used by many Unix-like file systems to store information about a file or directory, without including its name or its actual data. The inode is identified by an inode number, which uniquely identifies the file within the filesystem.

Inside an inode are metadata fields such as the file type, ownership (user and group IDs), access

Names are stored in directory entries that map filenames to inode numbers. This separation means that a

In many file systems, inodes are allocated in a fixed inode table created at filesystem creation. The

Access to a file’s metadata typically requires reading its inode from disk (e.g., via a stat operation).

permissions,
size
in
bytes,
and
timestamps
including
last
access,
modification,
and
change
times.
It
also
records
the
number
of
hard
links
to
the
file
and
various
flags.
Most
importantly,
the
inode
contains
pointers
to
the
disk
blocks
that
contain
the
file's
data,
typically
arranged
as
a
set
of
direct
pointers
and
indirect
pointers
for
larger
files.
file
can
have
multiple
hard
links,
all
referencing
the
same
inode.
The
file's
data
is
kept
on
disk
as
blocks
accessed
through
those
pointers;
when
all
links
are
removed
and
no
process
has
the
file
open,
the
space
can
be
freed
and
the
inode
reused.
number
and
size
of
inodes
affect
how
many
files
a
filesystem
can
hold.
Inodes
sizes
vary
by
filesystem;
common
sizes
range
from
128
to
256
bytes,
with
ext4
commonly
using
256-byte
inodes
and
ext2
often
using
128-byte
inodes
depending
on
block
size.
The
inode
number
is
often
displayed
by
tools
such
as
ls
-li,
and
hard
links
share
the
same
inode
number
while
different
filenames
map
to
the
same
inode.