Re: parsing /proc/<pid>/maps

Theodore Y. Ts'o (tytso@mit.edu)
Thu, 8 Oct 1998 03:11:31 -0400


From: lm@bitmover.com (Larry McVoy)
Date: Wed, 07 Oct 1998 21:31:42 -0600

I'm writing a perl script to put this in more readable format and I want to
convert from dev/inum to file name. Is there a script out there that does
that already? Thanks in advance.

Well, for ext2 filesystems, you can do this to find the pathname
corresponding to inode #2306 on /dev/hda2:

debugfs /dev/hda2 -R "ncheck 2306"

... but you need read access on the block device.

I don't think there's a way to do this in general from userspace,
unfortunately, short of recursively searching the filesystem looking for
the inode with the matching inode #.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/