Unix administration - [newbie] Questions about inodes

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2004 > [newbie] Questions about inodes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [newbie] Questions about inodes
Francesco

2004-01-23, 5:03 pm

Hi all,
I have the output from pfiles which shows all files opened. I'd like to know
if it's possible to know what file an inode correspond to ? (I'm mainly
interested
in files opened on the fs. Unfortunately I don't have lsof installed).

One more question : I see that there's an inode entry also for IFSOCK
entries...forgive
my ignorance...but does sockets open inodes too ? (I thought they're only
for entries in the file system...)
Thanks a lot
Francesco


Michael Vilain

2004-01-23, 5:03 pm

In article <jddcb.343111$lK4.10973426@twister1.libero.it>,
"Francesco" <marchioni.NOSPAM@libero.it> wrote:
quote:

> Hi all,
> I have the output from pfiles which shows all files opened. I'd like to know
> if it's possible to know what file an inode correspond to ? (I'm mainly
> interested
> in files opened on the fs. Unfortunately I don't have lsof installed).
>
> One more question : I see that there's an inode entry also for IFSOCK
> entries...forgive
> my ignorance...but does sockets open inodes too ? (I thought they're only
> for entries in the file system...)



If you have the inode #, use find to get the filename. Tedious, but you
don't have lsof, so enjoy the pain.

Named sockets are entries on a filesystem and you actually see them in a
directory. Don't know about other types of sockets. My guess is that
they would also have inodes. Isn't this really implementation dependent
or is it a standard?

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Jay Lessert

2004-01-23, 5:03 pm

"Francesco" <marchioni.NOSPAM@libero.it> wrote in message news:<jddcb.343111$lK4.10973426@twister1.libero.it>...
quote:

> Hi all,
> I have the output from pfiles which shows all files opened. I'd like to know
> if it's possible to know what file an inode correspond to ? (I'm mainly
> interested
> in files opened on the fs. Unfortunately I don't have lsof installed).



You don't say what OS you're running, but if you have pfiles,
you probably have a /proc file system.

% cd /proc/pid/fd

The file handles are listed here, same as the pfiles output.

On linux (2.4 kernel, anyway) it'll try to make this a symlink
to the real file, if it can. Done.

On Solaris, there's no symlink, but you can df and get the
file system, then 'find -inum' to get the file.

The file may be open but unlinked, in which case there *is*
no file name, per se.

-Jay-
Francesco

2004-01-23, 5:03 pm

Hi all,
thanks for your kind answers.
quote:

> You don't say what OS you're running, but if you have pfiles,


oops sorry. I'm running both Solaris and Linux OS, anyway as you said
on Linux is quite easier to extract fd info as it's a symbolic link in the
/proc fs.
Thanks again
Francesco

"Jay Lessert" <jayl-news@accelerant.net> ha scritto nel messaggio
news:7109f92b.0309241116.64bcd50f@posting.google.com...
quote:

> "Francesco" <marchioni.NOSPAM@libero.it> wrote in message


news:<jddcb.343111$lK4.10973426@twister1.libero.it>...
quote:

know[QUOTE][color=darkred]
>
> You don't say what OS you're running, but if you have pfiles,
> you probably have a /proc file system.
>
> % cd /proc/pid/fd
>
> The file handles are listed here, same as the pfiles output.
>
> On linux (2.4 kernel, anyway) it'll try to make this a symlink
> to the real file, if it can. Done.
>
> On Solaris, there's no symlink, but you can df and get the
> file system, then 'find -inum' to get the file.
>
> The file may be open but unlinked, in which case there *is*
> no file name, per se.
>
> -Jay-




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com