DEPARTMENT OF COMPUTING

What is an inode?


Viewing inodes


More testing with inodes


Other inode implications


More Inode stuff

Where is the NAME of the file. Or the Path? It’s NOT in the inode. It’s NOT in the data blocks. It’s in the directory. That’s right. A “file” is really in three (or more) places on the disk.

You see, the directory is just a table that contains the filenames in the directory, and the matching inode. Think of it as a table, and the first two entries are always “.” and “..” The first points to the inode of the current directory, and the second points to the inode of the parent directory.


One more piece of information

When you create a hard link, it just created a new name in the table, along with the inode, without moving the file. When you move a file (or rename it), you don’t copy the data. That would be Slow. You just create the (name,inode) entry in a new directory, and delete the old entry in the table inside the old directory entry. In other words, moving a gigabyte file takes very little time. In the same way, you can move/rename directories very easily. That’s why “mv /usr /Old_usr” is so fast, even though “/usr” may contain (for example) 57981 files.


Inode Examples


Inode Examples


Finding with inodes.


Last Updated 05/08/2023