The term ``inode'' stands for information node.
A list of inodes is called an ``i-list'' and the position
of an inode in an i-list is called an ``i-number''.
An inode contains all the information about a file except
its name, which is kept in a directory.
Inodes are 64 bytes long:
on a disk with 512-byte physical blocks
there are 8 of them in a physical block.
The length of an i-list is not fixed; it depends on the
number of inodes specified when the filesystem is created.
What does an s5 inode contain?
An s5 inode contains the following:
type and mode of the file--the type can be regular,
directory, block, character,
symbolic link, or FIFO, also known as named pipe;
the mode is the set of read-write-execute permissions
number of hard links to the file
user ID of the owner of the file
group ID to which the file belongs
number of bytes in the file
array of 13 disk block addresses
date and time the file was last accessed
date and time the file was last modified
date and time the file was created
The s5 disk inode's disk block addresses
The array of 13 disk block addresses
is the heart of the inode.
The first ten (addresses 0-9)
are direct addresses;
that is, they point directly to
the first ten logical storage blocks of
the contents of the file.
If the file is larger than ten logical blocks,
the 11th address (10) points to an indirect block, which
contains direct addresses instead of file contents.
The 12th address (11) points to a
double indirect block,
which contains addresses of indirect blocks.
The 13th address in the array (12)
is the address of a triple indirect block,
which contains addresses of double indirect blocks.
The next figure illustrates
this chaining of address blocks stemming from the inode.
The address chain in an s5 filesystem
The following table shows
the number of bytes addressable by
the different levels of indirection in
the inode address array for s5 filesystems.
These numbers are calculated
using the logical block size of the filesystem
and the number of bytes (4) used to hold an address.
Maximum number of bytes addressable by
Logical
Block Size
Direct
Blocks
Single
Indirect
Blocks
Double
Indirect
Blocks
Triple
Indirect
Blocks
512 bytes
5120
64KB
8MB
1GB
1024 bytes
10240
256KB
64MB
16GB
2048 bytes
20480
1MB
512MB
256GB
The table shows the number of
bytes addressable using
the level of indirection in
the column header plus all lower levels of addressing.
For example, the table values
for single indirect blocks also
include bytes addressable by direct blocks;
and the table values for triple indirect blocks include
bytes addressable by direct blocks
and single and double indirect blocks.
The theoretical maximum size of an s5 system file
is the same as the size of
a file addressable with triple indirection
(shown in the last column of the table).
In practice, however, file size is limited by
the size field in the inode.
This is a 32-bit field, so file sizes
are limited to 2GB.