Finding filename from inode

Finding filename from inode

Post by Mike Kenned » Sat, 20 Feb 1999 04:00:00



How can I find the filename string from the inode in the ext2 filesystem?
I know that all the filenames are stored as directory entries. But how do
you access the directory entries?

:===========================================================:

: Systems Administrator                 (909) 787-2946      :
: Computer Science Department                               :
: University of California, Riverside                       :
:===========================================================:

 
 
 

Finding filename from inode

Post by Mike Kenned » Sat, 20 Feb 1999 04:00:00


Sorry... let me re phrase... I meant within kernel space... how can I find
the filename from the inode. I know it involves looking for a directory
entry that contains that inode, but how can I get the directory entry when
all I have is the file inode?

:===========================================================:

: Systems Administrator                 (909) 787-2946      :
: Computer Science Department                               :
: University of California, Riverside                       :
:===========================================================:


> 'debugfs <devicename>'
> then at the prompt type
> 'ncheck <inode #>'

> Seth


> > How can I find the filename string from the inode in the ext2 filesystem?
> > I know that all the filenames are stored as directory entries. But how do
> > you access the directory entries?

> > :===========================================================:

> > : Systems Administrator                 (909) 787-2946      :
> > : Computer Science Department                               :
> > : University of California, Riverside                       :
> > :===========================================================:


 
 
 

Finding filename from inode

Post by Seth Van Oor » Sun, 21 Feb 1999 04:00:00


'debugfs <devicename>'
then at the prompt type
'ncheck <inode #>'

Seth


> How can I find the filename string from the inode in the ext2 filesystem?
> I know that all the filenames are stored as directory entries. But how do
> you access the directory entries?

> :===========================================================:

> : Systems Administrator                 (909) 787-2946      :
> : Computer Science Department                               :
> : University of California, Riverside                       :
> :===========================================================:

 
 
 

Finding filename from inode

Post by Frank Ranne » Mon, 01 Mar 1999 04:00:00



> Sorry... let me re phrase... I meant within kernel space... how can I find
> the filename from the inode. I know it involves looking for a directory
> entry that contains that inode, but how can I get the directory entry when
> all I have is the file inode?

Basically you can't. For a start, there may be several several directory
entries
(hard links) to the inode, or none if the file was rm'ed while a process
held it
open. So the only way is to brute force search directory entries looking
for a match
to the inode number.

Regards, Frank Ranner

 
 
 

1. How to find a filename, given a inode num?

How do I figure out the file (or path) name to a file
or directory, given that I have the inode number?

I have an 'errpt -a' that show:

LABEL:          JFS_USER_HARDLINK
IDENTIFIER:     5ECE4A58

Date/Time:       Tue Aug  7 16:26:54
Sequence Number: 389234
Machine Id:      00089E3FA100
Node Id:         svnfs01
Class:           O
Type:            INFO
Resource Name:   SYSPFS

Description
INAPPROPRIATE FILE SYSTEM OPERATION

User Causes
DIRECTORY HARD LINK CREATED OR REMOVED

                Recommended Actions
                                REVIEW DETAILED DATA

                                Detail Data
                                DETECTING MODULE
                                jfs_remove
                                MAJOR/MINOR DEVICE NUMBER
                                000B 0001
                                INODE NUMBER
                                          573451
                                          DIRECTORY
                                          573451

I would like to know exactly what directory inode 573451 referes to...

--
-------------------------------------------------------------------
(-: Hiroshima 45, Chernobyl 86, Windows 95 :-)
Our ultimate goal is to make overloaded machines appear to be idle.
High performance, High reliability, Low cost -------- Pick any two.
-------------------------------------------------------------------
Rune Mossige, Systems Support Engineer, WesternGeco, Stavanger, Norway
Tel: (+47)51946869                             Mobile:(+47)90871024

2. How to boot from mirrored bootdisk?

3. How to get absoute filename/inode of currently running process?

4. 2.5.72: drivers/ide/legacy/pdc4030.c:843: error: `hwif' undeclared (first use in this function)

5. Help - what's with "cpio: filename: truncating inode number"?

6. Modem on com3 irq 5

7. Filename of Inodes

8. Has anyone used the New Microcom Modems with parallel port option

9. My filenames ended up as inode numbers, any help?

10. question about inode and filename

11. inode/filename question

12. Convert device major/minor or inode to filename?

13. Getting filename from inode