how to find out pathname from inode number


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users how to find out pathname from inode number
# 1  
Old 05-05-2007
Java how to find out pathname from inode number

Hi all

when I execute pmap command on one of my daemon process, I am able to see the following output.

Address Kbytes RSS Anon Locked Mode Mapped File
00010000 40 40 - - r-x-- irs026bmd
00028000 56 56 16 - rwx-- irs026bmd
00036000 280 264 144 - rwx-- [ heap ]
FBFFA000 8 8 8 - rwx-R [ stack tid=2 ]
FC000000 42800 42792 - - r--s- dev:85,60 ino:8464571
FEC30000 64 64 64 - rw--- [ anon ]
FEC50000 64 64 64 - rw--- [ anon ]
.
.
.
when I try to locate the file pointed by dev:85,60 ino:8464571 by executing the command find / -xdev -inum 8464571, I coundn't find the pathname of the file.

Could anybody help me to find the filename from the inode number

Thx in advance
axes
# 2  
Old 05-05-2007
-xdev prevents descent into other filesystems. Normally lots of filesystems can be mounted off /. I think that is your problem. What file system is mounted on 85, 40?
# 3  
Old 05-05-2007
Another problem is that there can be any number of pathnames, including zero pathnames. We get newbie admins all the time who encounter a filled filesystem, locate a large file, and simply run "rm large_file" without checking to see if the file is open. And then they wonder why the space was not freed. Smilie

But this situation could be intentional too. Lots of programs open a temporary file, unlink it, and then use it. This results in very good security since no other program can access that file. And it arranges for the file to automatically disappear when the program exits.

Also be aware that there can be many pathnames as well. Your question seems to imply an assumption of exactly one pathname per file. Filesystems don't work that way in unix.
# 4  
Old 09-26-2008
list path of a directory

thanks
helped me too
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Inode number changes for a file in Redhat Linux

Hi, I have created a file a.txt in Redhat Linux. Inode number for a file changes every time i update the file using vi editor , gedit etc. Is there any setting that can be made , such that inode number never changes as that is supposed to be the expected behavior? Or if we cannot... (13 Replies)
Discussion started by: srirammanohar
13 Replies

2. Solaris

Retreive deleted file name if you having inode number

Some one please help me to find deleted file name, if I am having inode number in Solaris without using any 3rd party tool. Thanks :) (3 Replies)
Discussion started by: aksijain
3 Replies

3. Shell Programming and Scripting

Modifying a file without changing inode number

Hi all, I am struggling to change the content of a file without changing the inode number. The exact issue is as below. I have a file name test.bak which has 100 lines of text. I am trying to to delete the first 90 lines of the text in the file. I know that using sed/awk/head/tail I can... (3 Replies)
Discussion started by: sathishkmrv
3 Replies

4. UNIX for Dummies Questions & Answers

How to find all files containing "1234" in their inode number?

Hi, if there are 3 files with the following inode numbers: 012345 012346 012347 is there a way to find all those files containing "1234" as inode? i found out that i cant use any wildcards. or i just didnt put them in the right way. find . -inum ... ? thanks 4 help. devil (2 Replies)
Discussion started by: daredevil82m
2 Replies

5. AIX

How to get the filename of which has been deleted if I know the inode number?

How to get the filename of which has been deleted if I know the inode number. i can use the command "istat" to get the inode number of the file. # istat /proc//fd/x If this file has been deleted,but the process of this file has not been closed and handle has not been released ,so this... (3 Replies)
Discussion started by: JoyOnLine
3 Replies

6. UNIX for Dummies Questions & Answers

Using find with -prune to skip a specific pathname using Solaris

I'm trying to prune out the findings of a certain directory path and have something like the following workiing on Linux (Linux 2.6.9-67.0.7.ELsmp #1 SMP x86_64): find . -path 'test/tmp' -prune -o -print I now need to have this working on sun/solaris (SunOS 5.8 Generic_117350-34 sun4u sparc... (12 Replies)
Discussion started by: antonino
12 Replies

7. UNIX for Dummies Questions & Answers

Number of Inode on a disk

How we can know number of inode present in my Disk including free and occupied. Is there any tool or program to know how much free inode are there in inode free list . (2 Replies)
Discussion started by: mr_deb
2 Replies

8. Filesystems, Disks and Memory

Inode number

as kernel keeps track of user activities on a file by its INODE number and I node table . what is the structure of Inode table. and where does this Inode table mapped into?user space or kernel space? is the Inode Number is fixed for a file till its deletion? thanks (1 Reply)
Discussion started by: compbug
1 Replies

9. UNIX for Dummies Questions & Answers

Directory Inode Number Not Unique

Hi, I know that inode for each file is unique, but is it the for the directory? So far I found different directories has the same inode nubmer when you do ls -i, could some one explain why? Thanks a lot. (9 Replies)
Discussion started by: nj302
9 Replies

10. UNIX for Dummies Questions & Answers

find without pathname

How can I get the results of a find back without the pathname for example if i do find ../../ -name \*.sql i dont want to see directory/directory/filename.sql I only want to see filename.sql (3 Replies)
Discussion started by: MBGPS
3 Replies
Login or Register to Ask a Question