The Wednesday 2005-04-06 at 06:39 -0700, Randall R Schulz wrote:
So the only way to find what names refer to the same inode is to enumerate directory entries and compare inode numbers.
Ah, I see. So it is not easy as well to know if a file somewhere is hardlinked somewhere else, except by comparing all inode entries in all directory lists from the same partition/disk.
Precisely. In fact, back in the bad old days when there was just "the Unix file system," there used to be (and probably still is, under a name I don't know) a utility called "ncheck" that would take a device name and an inode number and find all the full path names that referred to that inode. It took forever because it had to walk the directory structure exhaustively looking for references to that inode.
I have found this one: xfs_ncheck - generate pathnames from i-numbers for XFS DESCRIPTION xfs_ncheck with no -i arguments generates an inode number and pathname list of all files on the given filesystem. Names of directory files are followed by /.. The output is not sorted in any particular order. The filesystem to be examined is specified by the xfs_special argument, which should be the disk or volume device for the filesys tem. Filesystems stored in files can also be checked, using the -f flag.
Do you know of a (brief) description of how a inode fs works, somewhere? I come from Dos; I did study how FAT worked in detail, but unix was out of bounds for me at the time, and later I had no occasion to study ext2 or similar. So, although I have some inkling of what an inode is, I really don't know O:-)
I did a little looking. This seems accurate and detailed, at least w.r.t. ext2: <http://www.tldp.org/LDP/tlk/fs/filesystem.html>. Most of what I could find wouldn't add to the knowledge you already have.
I have saved it and will read it. Seems interesting. Ahh! An inode is simply an structure listing file properties and the list of blocks it occupies. And inodes are grouped in tables, repeating info. How simple! :-) Perhaps I oversimplify. -- Cheers, Carlos Robinson