LearnViz CompSci
Home / Learn / Operating Systems / Inodes

Advanced Topic 36 of 51 Operating Systems

Inodes

Metadata records describing files in Unix file systems.

How it works

An inode is a Unix file-system data structure that stores a file's metadata: type, permissions, owner, size, timestamps, link count and pointers to its data blocks, but not its name. Directories map names to inode numbers, so one inode can have several names, called hard links. Pointers include direct blocks plus single, double and triple indirect blocks to support large files.

Step-by-step walkthrough

  1. A directory maps a name to an inode number.
  2. The inode stores size, owner, permissions and times.
  3. It also holds pointers to the data blocks.
  4. More pointers lead to further blocks.
  5. The file name is not part of the inode, so hard links are possible.

Where it is used

Commands like stat and ls -i show inode data. File systems have a fixed or dynamic inode table, and tools such as find and rsync use inode information to detect hard links.

Common pitfall

Running out of inodes prevents creating new files even with free space, which happens with millions of tiny files. Hard links cannot cross file systems or link to directories. Deleting a name does not free data while other links or open handles remain. Renames within a file system change directories but not the inode.

Where it fits in the course

Inodes is topic 36 of 51 in Operating Systems, rated Advanced. It follows File Systems. The next topic is Directory Structures.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Operating Systems quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Inodes?
Metadata records describing files in Unix file systems. It belongs to Operating Systems and is an advanced-level topic.
Where do people use Inodes?
Commands like stat and ls -i show inode data.
What is the most common mistake with Inodes?
Running out of inodes prevents creating new files even with free space, which happens with millions of tiny files.
What should I learn before this topic?
Start with File Systems, the topic just before it in Operating Systems.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Operating Systems quiz.
Is Inodes hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn Inodes?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Inodes?
File Systems, Directory Structures, Memory Mapped Files are closely connected. The full list is in the related topics section of this page.
What should I study after Inodes?
Continue with Directory Structures, the next topic in Operating Systems.

Related topics