开发者

Inode Number is changing

I'm having a problem with inode number. When I mount o开发者_StackOverflowne 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.


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:

  • Discussion about a bug related to this problem on the findutils mailing list
  • Linux kernel sources: fs/fat/inode.c (in particular, the call to iunique in fat_build_inode which performs the inode number allocation).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜