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?

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.

  • Thanks for the clarification! Haha, how did inodes affect the way of restoring backups? – chromechris Nov 5 '16 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). – Thomas Dickey Nov 5 '16 at 11:51
  • Ohh, haha. So the recovery backup was removed from the system right? Then inserted back in? – chromechris Nov 6 '16 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.