[BBLISA] Mapping inode numbers to file names

Daniel Hagerty hag at linnaean.org
Tue Apr 27 23:33:46 EDT 2010


Edward Ned Harvey <bblisa3 at nedharvey.com> writes:

> AFAIK, debugfs is ext2/ext3 only.  Even so, I didn't immediately see any way
> to do that in the man page, even if ext2/ext3 were relevant in the present
> case.

    You won't.  While find may be expensive, it's pretty much
following the algorithm you have to use on ufs/ffs/ext? .

    I dunno about zfs, but you can try reading
http://hub.opensolaris.org/bin/download/Community+Group+zfs/docs/ondiskformat0822.pdf
to see if the on-disk format offers anything over the obvious "run
find".

If you can't find something in zfs that actually writes this into the
filesystem, you are probably SoL.  name -> inode and vice-versa is
traditionally assumed to be expensive in unix, and this is reflected
in the design of the older filesystems.

You could take a look at how lsof does its magic in this area.
Chances are that it's just reading through the kernel namei cache, or
similar, and won't offer any help unless the file has been translated
to an inode recently.



More information about the bblisa mailing list