1

So if i move a file from one directory to another within one Filesystem, say "/opt" which is a mounted point, the i-node of that file stays consistent as long as the files stays within that mount-point "/opt". Now, if I move that file to say, "/usr", which is a different mount-point, the i-node of that file changes. Is there a way to keep the i-node of a file consistent when moving the file across filesystems?

1 Answer 1

3

no - the inode is "assigned" by the filesystem (i.e., driver within the kernel).

In theory (using some low-level tool), you could write onto a specific inode, but in practice you would really not want to do this (too much work and too much chance of breakage).

A while back, I worked with someone who had the (not) bright idea of using inode numbers as unique identifiers for files. That came to an end when considering how to restore a backup.

3
  • Thanks for the clarification! Haha, how did inodes affect the way of restoring backups? Commented Nov 5, 2016 at 3:51
  • They did not find it possible to restore the files with the same inode values (due to the nature of the application, using dd to save a raw device was not considered). Commented Nov 5, 2016 at 11:51
  • Ohh, haha. So the recovery backup was removed from the system right? Then inserted back in? Commented Nov 6, 2016 at 1:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.