Mapping inode numbers to file names

Richard Pieri richard.pieri-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Apr 27 21:53:39 EDT 2010


On Apr 27, 2010, at 9:22 AM, Edward Ned Harvey wrote:
> 
> Is there any faster way to find the file name(s) when all you know is the
> inode number?  (Actually, all you know is all the info that's in the present
> directory, which is not limited to inode number; but, inode number is the
> only information that I personally know could be useful.)

Not the way that you seem to want.  inodes specifically do not contain any file naming references.  This is intentional.  It's how hard links on Unix work (and cross-linked files on FAT... er... don't).  What you need to do is traverse the raw directory data for the filesystem looking for the inode you want and matching it to one or more file names.  Yes, this will be slow.  No, there's no way around it.  You're stuck doing an exhaustive search if you want to go backwards.

--Rich P.







More information about the Discuss mailing list