Carlos, On Sunday 10 April 2005 15:15, Carlos E. R. wrote:
...
... 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.
That's it exactly. I'm surprised there aren't counterparts for the other file system formats.
...
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!
Good ideas are often simple. And in retrospect, obvious. Coming at them from the perspective of the inventor, it's often not so clear what will work best.
:-)
Perhaps I oversimplify.
In fact, you do not. That's exactly it. Now exactly how you represent the "list of blocks it occupies" and get space and time efficiency and robustness in the face of failure and how you structure the free space index and how you lay out on-disk structures all introduce complications into real-world file system designs and implementations. But the inode table + directory tree structure is the essence of all Unix file systems.
-- Cheers, Carlos Robinson
Randall Schulz