Inode number is changing

I have a problem with the inode number. When I mount one USB drive (say usb-a) and then mount another USB drive (usb-b), the inode number in usb-a changes.

This is normal? what can cause this problem? I am using Linux kernel 2.6. usb-a is vfat, and usb-b is ntfs.

Thanks in advance guys.

+4
source share
1 answer

FAT file systems (and similarly VFAT) do not actually store inodes on disk. Instead, Linux invents inode numbers on the fly for files as they are visible. These generated inode numbers are stored in the cache to try to keep them consistent, but this cache has a fixed size; once it is full, old entries will be discarded.

Presumably, the action of mounting your second file system is sufficient to make the input number cache in the VFAT file system forget about your files, causing the allocation of new inode numbers and presenting the problem you are observing.

Additional Information:

  • Discussion about the error associated with this problem on the findutils mailing list
  • Sources of the Linux kernel: fs / fat / inode.c (in particular, calling iunique in fat_build_inode , which performs the assignment of the inode number).
+6
source

Source: https://habr.com/ru/post/1335220/


All Articles