Open In App

Inode vs Vnode

Inode doesn’t contain files actual data but it contains the metadata about the file such as the file size, User Id, Protection information etc. It isn’t a kernel data structure and can be accessed quickly, They are always valid as they contain the information that is always needed. They are independent of the file names, even if the name of the file is changed the inode doesn’t change.

Index-Node (Inode):



1)Disk Inode consists of :

2) In- core Inode consists of:



Features of Inode:

Vnode is a kernel memory object that opens, reads writes, closes and does similar actions on the UNIX file interface. It can also be defined as an abstraction of the inode. It only exists when the file is opened. Being an object it has more access time compared to the inode. It contains data that does not change over the file’s lifetime.

Features of Vnode:

Similarities between Inode and Vnode:

Following is a table of Differences between Inode and Vnode:

 

Inode

Vnode

1. Inodes have metadata about the file which is not related to the content of the file Vnodes contain attributes that do not change over the file’s lifetime
2. Inode is an on-disk structure that explains the storage of a file in terms of disk Vnode is an in-memory structure abstraction of inode
3. Inode isn’t a data structure of the kernel   Vnode is an in-kernel representation of the inode.
4. It can be accessed quickly  It has more access time than Inode
5. Inodes are always valid  Vnode are not necessarily always valid
6. It contains information that is always needed (Ex. protection, admin power) Vnode only exists when a file is opened
7. Inode is associated with unique number within a partition Vnode doesn’t have a unique number within a partition
8. It is however a data structure in UNIX operating systems Vnode is an object in kernel memory that speaks for the UNIX file interface
Article Tags :