Can inode number be changed?
Jessica Cortez
Updated on April 12, 2026
Likewise, how can you change the inode associated with a regular file?
So the only way to change the inode number is to copy the file to a new file (which then would get a new inode). The filesystem is responsible for managing the inodes, you can't just "choose" one you like.
Similarly, can two files have same inode number? So, for all files there is only one inode, unless the file is a link. In that case, you have two or more files referring to the same inode. Of course, the inode number is unique only on the filesystem where the file exists. Files across different filesystems can have the same inode number.
Also, what happens to an inode when you move a file?
A inode (directory or file) always resides in directory. The move within file system is simple such that source directory entry is modified that inode is deleted and target directory is modified that inode is added. And the move operation happens in constant time irrespective of the size of the inode.
Can you open a file if you only know its inode number?
By itself, a UNIX file has no name, only an inode number or inum. But you can only access it through an entry in a special "directory" file that associates a name with the inum in question; you can't specify the inum directly. Then the file is actually deleted and its space marked as available for reuse.