<s>
The	O
inode	B-Application
(	O
index	B-Application
node	I-Application
)	O
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
in	O
a	O
Unix-style	B-Application
file	I-Application
system	I-Application
that	O
describes	O
a	O
file-system	B-Application
object	O
such	O
as	O
a	O
file	B-Operating_System
or	O
a	O
directory	B-Application
.	O
</s>
<s>
Each	O
inode	B-Application
stores	O
the	O
attributes	O
and	O
disk	O
block	O
locations	O
of	O
the	O
object	O
's	O
data	O
.	O
</s>
<s>
File-system	B-Application
object	O
attributes	O
may	O
include	O
metadata	O
(	O
times	O
of	O
last	O
change	O
,	O
access	O
,	O
modification	O
)	O
,	O
as	O
well	O
as	O
owner	O
and	O
permission	O
data	O
.	O
</s>
<s>
A	O
directory	B-Application
is	O
a	O
list	O
of	O
inodes	B-Application
with	O
their	O
assigned	O
names	O
.	O
</s>
<s>
There	O
has	O
been	O
uncertainty	O
on	O
the	O
Linux	B-Application
kernel	I-Application
mailing	I-Application
list	I-Application
about	O
the	O
reason	O
for	O
the	O
"	O
i	O
"	O
in	O
"	O
inode	B-Application
"	O
.	O
</s>
<s>
In	O
2002	O
,	O
the	O
question	O
was	O
brought	O
to	O
Unix	B-Application
pioneer	O
Dennis	O
Ritchie	O
,	O
who	O
replied	O
:	O
</s>
<s>
A	O
1978	O
paper	O
by	O
Ritchie	O
and	O
Ken	O
Thompson	O
bolsters	O
the	O
notion	O
of	O
"	O
index	O
"	O
being	O
the	O
etymological	O
origin	O
of	O
inodes	B-Application
.	O
</s>
<s>
They	O
wrote	O
:	O
Additionally	O
,	O
Maurice	O
J	O
.	O
Bach	O
wrote	O
that	O
an	O
inode	B-Application
"	O
is	O
a	O
contraction	O
of	O
the	O
term	O
index	B-Application
node	I-Application
and	O
is	O
commonly	O
used	O
in	O
literature	O
on	O
the	O
UNIX	B-Application
system	I-Application
"	O
.	O
</s>
<s>
A	O
file	B-Application
system	I-Application
relies	O
on	O
data	B-General_Concept
structures	I-General_Concept
about	O
the	O
files	O
,	O
as	O
opposed	O
to	O
the	O
contents	O
of	O
that	O
file	B-Operating_System
.	O
</s>
<s>
Each	O
file	B-Operating_System
is	O
associated	O
with	O
an	O
inode	B-Application
,	O
which	O
is	O
identified	O
by	O
an	O
integer	O
,	O
often	O
referred	O
to	O
as	O
an	O
i-number	O
or	O
inode	B-Application
number	I-Application
.	O
</s>
<s>
Inodes	B-Application
store	O
information	O
about	O
files	O
and	O
directories	B-Application
(	O
folders	O
)	O
,	O
such	O
as	O
file	B-Operating_System
ownership	O
,	O
access	O
mode	O
(	O
read	O
,	O
write	O
,	O
execute	O
permissions	O
)	O
,	O
and	O
file	B-Operating_System
type	O
.	O
</s>
<s>
On	O
many	O
older	O
file	B-Application
system	I-Application
implementations	O
,	O
the	O
maximum	O
number	O
of	O
inodes	B-Application
is	O
fixed	O
at	O
file	B-Application
system	I-Application
creation	O
,	O
limiting	O
the	O
maximum	O
number	O
of	O
files	O
the	O
file	B-Application
system	I-Application
can	O
hold	O
.	O
</s>
<s>
A	O
typical	O
allocation	O
heuristic	O
for	O
inodes	B-Application
in	O
a	O
file	B-Application
system	I-Application
is	O
one	O
inode	B-Application
for	O
every	O
2K	O
bytes	B-Application
contained	O
in	O
the	O
filesystem	B-Application
.	O
</s>
<s>
Some	O
Unix-style	O
file	B-Application
systems	I-Application
such	O
as	O
ZFS	B-Application
,	O
OpenZFS	B-Operating_System
,	O
ReiserFS	B-Application
,	O
btrfs	B-Operating_System
,	O
and	O
APFS	B-Application
omit	O
a	O
fixed-size	O
inode	B-Application
table	O
,	O
but	O
must	O
store	O
equivalent	O
data	O
in	O
order	O
to	O
provide	O
equivalent	O
capabilities	O
.	O
</s>
<s>
The	O
data	O
may	O
be	O
called	O
stat	B-Language
data	O
,	O
in	O
reference	O
to	O
the	O
stat	B-Language
system	B-Operating_System
call	I-Operating_System
that	O
provides	O
the	O
data	O
to	O
programs	O
.	O
</s>
<s>
Common	O
alternatives	O
to	O
the	O
fixed-size	O
table	O
include	O
B-trees	B-Architecture
and	O
the	O
derived	O
B+	O
trees	O
.	O
</s>
<s>
The	O
inode	B-Application
number	I-Application
indexes	O
a	O
table	O
of	O
inodes	B-Application
in	O
a	O
known	O
location	O
on	O
the	O
device	O
.	O
</s>
<s>
From	O
the	O
inode	B-Application
number	I-Application
,	O
the	O
kernel	O
's	O
file	B-Application
system	I-Application
driver	O
can	O
access	O
the	O
inode	B-Application
contents	O
,	O
including	O
the	O
location	O
of	O
the	O
file	B-Operating_System
,	O
thereby	O
allowing	O
access	O
to	O
the	O
file	B-Operating_System
.	O
</s>
<s>
A	O
file	B-Operating_System
's	O
inode	B-Application
number	I-Application
can	O
be	O
found	O
using	O
the	O
ls	O
-i	O
command	O
.	O
</s>
<s>
The	O
ls	O
-i	O
command	O
prints	O
the	O
inode	B-Application
number	I-Application
in	O
the	O
first	O
column	O
of	O
the	O
report	O
.	O
</s>
<s>
File	B-Operating_System
names	O
and	O
directory	B-Application
implications	O
:	O
</s>
<s>
Inodes	B-Application
do	O
not	O
contain	O
their	O
hard	B-Application
link	I-Application
names	O
,	O
only	O
other	O
file	B-Operating_System
metadata	O
.	O
</s>
<s>
Unix	B-Application
directories	B-Application
are	O
lists	O
of	O
association	O
structures	O
,	O
each	O
of	O
which	O
contains	O
one	O
filename	O
and	O
one	O
inode	B-Application
number	I-Application
.	O
</s>
<s>
The	O
file	B-Application
system	I-Application
driver	O
must	O
search	O
a	O
directory	B-Application
for	O
a	O
particular	O
filename	O
and	O
then	O
convert	O
the	O
filename	O
to	O
the	O
correct	O
corresponding	O
inode	B-Application
number	I-Application
.	O
</s>
<s>
The	O
operating	O
system	O
kernel	O
's	O
in-memory	O
representation	O
of	O
this	O
data	O
is	O
called	O
struct	O
inode	B-Application
in	O
Linux	B-Application
.	O
</s>
<s>
Systems	O
derived	O
from	O
BSD	B-Operating_System
use	O
the	O
term	O
vnode	B-Application
(	O
the	O
"	O
v	O
"	O
refers	O
to	O
the	O
kernel	O
's	O
virtual	B-Application
file	I-Application
system	I-Application
layer	O
)	O
.	O
</s>
<s>
The	O
POSIX	O
standard	O
mandates	O
file-system	B-Application
behavior	O
that	O
is	O
strongly	O
influenced	O
by	O
traditional	B-Application
UNIX	I-Application
file	B-Application
systems	I-Application
.	O
</s>
<s>
An	O
inode	B-Application
is	O
denoted	O
by	O
the	O
phrase	O
"	O
file	B-Operating_System
serial	O
number	O
"	O
,	O
defined	O
as	O
a	O
per-file	O
system	O
unique	O
identifier	O
for	O
a	O
file	B-Operating_System
.	O
</s>
<s>
That	O
file	B-Operating_System
serial	O
number	O
,	O
together	O
with	O
the	O
device	O
ID	O
of	O
the	O
device	O
containing	O
the	O
file	B-Operating_System
,	O
uniquely	O
identify	O
the	O
file	B-Operating_System
within	O
the	O
whole	O
system	O
.	O
</s>
<s>
Within	O
a	O
POSIX	O
system	O
,	O
a	O
file	B-Operating_System
has	O
the	O
following	O
attributes	O
which	O
may	O
be	O
retrieved	O
by	O
the	O
stat	B-Language
system	B-Operating_System
call	I-Operating_System
:	O
</s>
<s>
Device	O
ID	O
(	O
this	O
identifies	O
the	O
device	O
containing	O
the	O
file	B-Operating_System
;	O
that	O
is	O
,	O
the	O
scope	O
of	O
uniqueness	O
of	O
the	O
serial	O
number	O
)	O
.	O
</s>
<s>
File	B-Operating_System
serial	O
numbers	O
.	O
</s>
<s>
The	O
file	B-Operating_System
mode	O
which	O
determines	O
the	O
file	B-Operating_System
type	O
and	O
how	O
the	O
file	B-Operating_System
's	O
owner	O
,	O
its	O
group	O
,	O
and	O
others	O
can	O
access	O
the	O
file	B-Operating_System
.	O
</s>
<s>
A	O
link	B-General_Concept
count	I-General_Concept
telling	O
how	O
many	O
hard	B-Application
links	I-Application
point	O
to	O
the	O
inode	B-Application
.	O
</s>
<s>
The	O
User	B-Application
ID	I-Application
of	O
the	O
file	B-Operating_System
's	O
owner	O
.	O
</s>
<s>
The	O
Group	B-Application
ID	I-Application
of	O
the	O
file	B-Operating_System
.	O
</s>
<s>
The	O
device	O
ID	O
of	O
the	O
file	B-Operating_System
if	O
it	O
is	O
a	O
device	B-Application
file	I-Application
.	O
</s>
<s>
The	O
size	O
of	O
the	O
file	B-Operating_System
in	O
bytes	B-Application
.	O
</s>
<s>
Timestamps	O
telling	O
when	O
the	O
inode	B-Application
itself	O
was	O
last	O
modified	O
(	O
,	O
inode	B-Application
change	O
time	O
)	O
,	O
the	O
file	B-Operating_System
content	O
last	O
modified	O
(	O
,	O
modification	O
time	O
)	O
,	O
and	O
last	O
accessed	O
(	O
,	O
access	O
time	O
)	O
.	O
</s>
<s>
The	O
preferred	O
I/O	B-General_Concept
block	O
size	O
.	O
</s>
<s>
The	O
number	O
of	O
blocks	O
allocated	O
to	O
this	O
file	B-Operating_System
.	O
</s>
<s>
Filesystems	B-Application
designed	O
with	O
inodes	B-Application
will	O
have	O
the	O
following	O
administrative	O
characteristics	O
:	O
</s>
<s>
If	O
multiple	O
names	O
hard	B-Application
link	I-Application
to	O
the	O
same	O
inode	B-Application
then	O
the	O
names	O
are	O
equivalent	O
;	O
i.e.	O
,	O
the	O
first	O
to	O
be	O
created	O
has	O
no	O
special	O
status	O
.	O
</s>
<s>
This	O
is	O
unlike	O
symbolic	B-Application
links	I-Application
,	O
which	O
depend	O
on	O
the	O
original	O
name	O
,	O
not	O
the	O
inode	B-Application
(	O
number	O
)	O
.	O
</s>
<s>
An	O
inode	B-Application
may	O
have	O
no	O
links	O
.	O
</s>
<s>
An	O
unlinked	O
file	B-Operating_System
is	O
removed	O
from	O
disk	O
,	O
and	O
its	O
resources	O
are	O
freed	O
for	O
reallocation	O
but	O
deletion	O
must	O
wait	O
until	O
all	O
processes	O
that	O
have	O
opened	O
it	O
finish	O
accessing	O
it	O
.	O
</s>
<s>
It	O
is	O
typically	O
not	O
possible	O
to	O
map	O
from	O
an	O
open	O
file	B-Operating_System
to	O
the	O
filename	O
that	O
was	O
used	O
to	O
open	O
it	O
.	O
</s>
<s>
The	O
operating	O
system	O
immediately	O
converts	O
the	O
filename	O
to	O
an	O
inode	B-Application
number	I-Application
and	O
then	O
discards	O
the	O
filename	O
.	O
</s>
<s>
This	O
means	O
that	O
the	O
and	O
library	O
functions	O
search	O
the	O
parent	B-Application
directory	I-Application
to	O
find	O
a	O
file	B-Operating_System
with	O
an	O
inode	B-Application
matching	O
the	O
working	B-Application
directory	I-Application
,	O
then	O
search	O
that	O
directory	B-Application
's	O
parent	O
,	O
and	O
so	O
on	O
until	O
reaching	O
the	O
root	B-Application
directory	I-Application
.	O
</s>
<s>
SVR4	O
and	O
Linux	B-Application
systems	O
maintain	O
extra	O
information	O
to	O
make	O
this	O
possible	O
.	O
</s>
<s>
Historically	O
,	O
it	O
was	O
possible	O
to	O
hard	B-Application
link	I-Application
directories	B-Application
.	O
</s>
<s>
This	O
made	O
the	O
directory	B-Application
structure	O
an	O
arbitrary	O
directed	O
graph	O
contrary	O
to	O
a	O
directed	O
acyclic	O
graph	O
.	O
</s>
<s>
It	O
was	O
even	O
possible	O
for	O
a	O
directory	B-Application
to	O
be	O
its	O
own	O
parent	O
.	O
</s>
<s>
The	O
most	O
notable	O
exception	O
to	O
this	O
prohibition	O
is	O
found	O
in	O
Mac	B-Application
OS	I-Application
X	I-Application
(	O
versions	O
10.5	O
and	O
higher	O
)	O
which	O
allows	O
hard	B-Application
links	I-Application
of	O
directories	B-Application
to	O
be	O
created	O
by	O
the	O
superuser	O
.	O
</s>
<s>
A	O
file	B-Operating_System
's	O
inode	B-Application
number	I-Application
stays	O
the	O
same	O
when	O
it	O
is	O
moved	O
to	O
another	O
directory	B-Application
on	O
the	O
same	O
device	O
,	O
or	O
when	O
the	O
disk	O
is	O
defragmented	B-Application
which	O
may	O
change	O
its	O
physical	O
location	O
,	O
allowing	O
it	O
to	O
be	O
moved	O
and	O
renamed	O
even	O
while	O
being	O
read	O
from	O
and	O
written	O
to	O
without	O
causing	O
an	O
interruption	O
.	O
</s>
<s>
This	O
also	O
implies	O
that	O
completely	O
conforming	O
inode	B-Application
behavior	O
is	O
impossible	O
to	O
implement	O
with	O
many	O
non-Unix	O
file	B-Operating_System
systems	O
,	O
such	O
as	O
FAT	B-Application
and	O
its	O
descendants	O
,	O
which	O
do	O
n't	O
have	O
a	O
way	O
of	O
storing	O
this	O
invariance	O
when	O
both	O
a	O
file	B-Operating_System
's	O
directory	B-Application
entry	O
and	O
its	O
data	O
are	O
moved	O
around	O
.	O
</s>
<s>
Installation	O
of	O
new	O
libraries	O
is	O
simple	O
with	O
inode	B-Application
file	B-Application
systems	I-Application
.	O
</s>
<s>
A	O
running	O
process	O
can	O
access	O
a	O
library	O
file	B-Operating_System
while	O
another	O
process	O
replaces	O
that	O
file	B-Operating_System
,	O
creating	O
a	O
new	O
inode	B-Application
,	O
and	O
an	O
all-new	O
mapping	O
will	O
exist	O
for	O
the	O
new	O
file	B-Operating_System
so	O
that	O
subsequent	O
attempts	O
to	O
access	O
the	O
library	O
get	O
the	O
new	O
version	O
.	O
</s>
<s>
It	O
is	O
possible	O
for	O
a	O
device	O
to	O
run	O
out	O
of	O
inodes	B-Application
.	O
</s>
<s>
This	O
is	O
most	O
common	O
for	O
use	O
cases	O
like	O
mail	B-Application
servers	I-Application
which	O
contain	O
many	O
small	O
files	O
.	O
</s>
<s>
File	B-Application
systems	I-Application
(	O
such	O
as	O
JFS	B-Application
or	O
XFS	B-Application
)	O
escape	O
this	O
limitation	O
with	O
extents	B-Application
or	O
dynamic	O
inode	B-Application
allocation	O
,	O
which	O
can	O
"	O
grow	O
"	O
the	O
file	B-Application
system	I-Application
or	O
increase	O
the	O
number	O
of	O
inodes	B-Application
.	O
</s>
<s>
It	O
can	O
make	O
sense	O
to	O
store	O
very	O
small	O
files	O
in	O
the	O
inode	B-Application
itself	O
to	O
save	O
both	O
space	O
(	O
no	O
data	O
block	O
needed	O
)	O
and	O
lookup	O
time	O
(	O
no	O
further	O
disk	O
access	O
needed	O
)	O
.	O
</s>
<s>
This	O
file	B-Application
system	I-Application
feature	O
is	O
called	O
inlining	O
.	O
</s>
<s>
The	O
strict	O
separation	O
of	O
inode	B-Application
and	O
file	B-Operating_System
data	O
thus	O
can	O
no	O
longer	O
be	O
assumed	O
when	O
using	O
modern	O
file	B-Application
systems	I-Application
.	O
</s>
<s>
If	O
the	O
data	O
of	O
a	O
file	B-Operating_System
fits	O
in	O
the	O
space	O
allocated	O
for	O
pointers	O
to	O
the	O
data	O
,	O
this	O
space	O
can	O
conveniently	O
be	O
used	O
.	O
</s>
<s>
For	O
example	O
,	O
ext2	B-Application
and	O
its	O
successors	O
store	O
the	O
data	O
of	O
symlinks	B-Application
(	O
typically	O
file	B-Operating_System
names	O
)	O
in	O
this	O
way	O
if	O
the	O
data	O
is	O
no	O
more	O
than	O
60	O
bytes	B-Application
(	O
"	O
fast	O
symbolic	B-Application
links	I-Application
"	O
)	O
.	O
</s>
<s>
Ext4	B-Application
has	O
a	O
file	B-Application
system	I-Application
option	O
called	O
inline_data	O
that	O
allows	O
ext4	B-Application
to	O
perform	O
inlining	O
if	O
enabled	O
during	O
file	B-Application
system	I-Application
creation	O
.	O
</s>
<s>
Because	O
an	O
inode	B-Application
's	O
size	O
is	O
limited	O
,	O
this	O
only	O
works	O
for	O
very	O
small	O
files	O
.	O
</s>
<s>
NTFS	B-Application
has	O
a	O
master	O
file	B-Operating_System
table	O
(	O
MFT	O
)	O
storing	O
files	O
in	O
a	O
B-tree	B-Architecture
.	O
</s>
<s>
Each	O
entry	O
has	O
a	O
"	O
fileID	O
"	O
,	O
analogous	O
to	O
the	O
inode	B-Application
number	I-Application
,	O
that	O
uniquely	O
refers	O
to	O
this	O
entry	O
.	O
</s>
<s>
The	O
three	O
timestamps	O
,	O
a	O
device	O
ID	O
,	O
attributes	O
,	O
reference	B-General_Concept
count	I-General_Concept
,	O
and	O
file	B-Operating_System
sizes	O
are	O
found	O
in	O
the	O
entry	O
,	O
but	O
unlike	O
in	O
POSIX	O
the	O
permissions	O
are	O
expressed	O
through	O
a	O
different	O
API	O
.	O
</s>
<s>
The	O
earlier	O
FAT	B-Application
file	I-Application
systems	I-Application
did	O
not	O
have	O
such	O
a	O
table	O
and	O
were	O
incapable	O
of	O
making	O
hard	B-Application
links	I-Application
.	O
</s>
<s>
NTFS	B-Application
also	O
has	O
a	O
concept	O
of	O
inlining	O
small	O
files	O
into	O
the	O
MFT	O
entry	O
.	O
</s>
<s>
ReFS	O
has	O
a	O
128-bit	O
file	B-Operating_System
ID	O
;	O
this	O
extension	O
was	O
also	O
backported	O
to	O
NTFS	B-Application
,	O
which	O
originally	O
had	O
a	O
64-bit	O
file	B-Operating_System
ID	O
.	O
</s>
<s>
The	O
same	O
stat-like	O
API	O
can	O
be	O
used	O
on	O
Cluster	O
Shared	O
Volumes	O
and	O
SMB	B-Operating_System
3.0	I-Operating_System
,	O
so	O
these	O
systems	O
presumably	O
have	O
a	O
similar	O
concept	O
of	O
a	O
file	B-Operating_System
ID	O
.	O
</s>
