Reputation: 331
I'm having a problem with inode number. When I mount one usb disk (let's say usb-a) and then mount another usb disk (usb-b) the inode number in usb-a is changed.
Is this normal? what may cause this issue? I'm using Linux Kernel 2.6. usb-a is vfat and usb-b is ntfs.
Thanks in advance guys.
Upvotes: 4
Views: 1810
Reputation: 6027
FAT (and similarly VFAT) file systems don't actually store inode numbers on disk. Instead, Linux invents inode numbers on-the-fly for files as they are seen. These generated inode numbers are stored in a cache to try and keep them consistent, but this cache has a fixed size; once it is full, older entries are thrown away.
Presumably the act of mounting your second filesystem is sufficient to cause the inode number cache on the VFAT filesystem to forget about your files, causing new inode numbers to be allocated, and presenting the problem you observe.
More information:
iunique
in fat_build_inode
which performs the inode number allocation).Upvotes: 6