An inode uniquely identifies a file on a filesystem. In your example, you are looking at three different filesystems: /
, /media/BACKUP_1
(presumably an external VFAT32 drive or stick) and /sys
.
These are three different filesystems; it is perfectly normal for the same inode number to be used on different filesystems. If inode numbers had to be unique across all filesystems, that would be a pretty harsh requirement, for several reasons:
- there could only be 2
sizeof(inode_t)
× BITS_PER_BYTE files in the entire world and
- every computer on the entire planet would need to be connected to every other computer all the time so that they don't accidentally hand out the same number twice.
Just imagine this: you create a file on your external device. Then you detach it and attach it to a different computer, which also creates a file. How would computer A know which inode numbers are already used by computer B?
Also, in your case there is a different peculiarity: /sys
is not a "real" filesystem, it is a virtual filesystem. It only exposes internal kernel datastructures as files and directories. And it doesn't even do this all the time, it only does this when you actually look at it – then, and only then do the files magically spring into existence. Therefore, its inode numbers are synthesized and don't really have any use at all – indeed, IIRC some virtual filesystems just set the inode number to 0
for every file, or at least they tried to until they realized that this broke all sorts of tools.
In addition to that, /media/BACKUP_1
is presumably a VFAT32 filesystem, which is a DOS filesystem. Inodes are a Unix concept, so VFAT32 doesn't even have inodes, and again they are synthesized.
Indeed, many modern Unix filesystems don't have inodes either, they store files in B+ trees or some other highly optimized data structure and address them implicitly through their position in the tree. I know that the Reiser4 filesystem had some trouble because in some cases they didn't synthesize inode numbers at all or synthesized very big inode numbers that again broke some tools. (Some stupid implementations of tools which needed to do things similar to find -inode
simply built an array from 0 to the highest inode number they could find, which would then consume all available memory on the machine if they were presented with an extremely large inode number.)