Get open file path from pfiles output

filesystemssolaris

We have detected performance issues in a Solaris 10 process and observed too much writes to descriptor 268 using truss.

We don't have lsof at hand, but here is an excerpt from pfiles output:

 [...]
 268: S_IFREG mode:0644 dev:321,11003 ino:13621 uid:101 gid:105 size:100014416
      O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE
 [...]

Is there a way to know the real file path from this information?

Thank you.

Best Answer

The ino value is the inode of the file on the filesystem, in your case 13621 so you could use find's -inum option like so (where $filesystem_name is a filesystem on your machine:

find /$filesystem_name -inum 13621

Inodes are unique per filesystem, so if you have multiple filesystems you might want to check them individually.

There are some nice dtrace scripts on the web for finding activity on filesystems:

http://forums.sun.com/thread.jspa?threadID=5075136