- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to find opened file by NODE NUMBER
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2010 11:38 PM
03-31-2010 11:38 PM
In my application one process id is opening multilple file handlers through application , based on the NODE number can i find which file has been opened
ex :
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
cor 19891 fwsup01a 78u REG 3,0xa 88 18125768 /fwdev3/data (cbfp0004:/vol/fv_FUSD1_APP04954_cbs_pa_0/qt_FUSD1_APP04954_pa_fwdev3_0)
from FD i can see that it is a rea write REGULAR FILE for the process id 19891 , where as cor is my application process name
from the above can i know what is file handle it is opened and the path ?
please reply me
Solved! Go to Solution.
- Tags:
- inode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 01:19 AM
04-01-2010 01:19 AM
SolutionIn this case, it's the directory /fwdev3/data, which seems to be a NFS mount from cbfp0004:/vol/fv_FUSD1_APP04954_cbs_pa_0/qt_FUSD1_APP04954_pa_fwdev3_0.
But if you don't have the name, you would have to first use the DEVICE field to identify the correct device by its major/minor numbers. In this case, the numbers are 3,0xa; so the major number is 3 and the minor number is 0xa in hexadecimal (= 10 in decimal). The minor number is usually expressed in 6-digit form, i.e. 0xa = 0x00000a.
First, you might use "lsdev -e
With NFS devices, the minor device numbers cannot be looked up from /dev, so some guesswork is required.
Once you know the mount point, you can use the mount point and the NODE number (the inode number of the file) with the "find" command to locate the file.
For example, if you knew the mountpoint is /mountpoint and the NODE field is 12345, you would find the file using:
find /mountpoint -inum 12345
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 01:20 AM
04-01-2010 01:20 AM
Re: How to find opened file by NODE NUMBER
The second line isn't the path?
Basically if 18125768 is the inum, and you know the file system, you can do:
find file-system -inum 18125768
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 01:33 AM
04-01-2010 01:33 AM
Re: How to find opened file by NODE NUMBER
when try to run the given command i am getting error
cbh10702 $
find file-system -inum 18125768
find: cannot stat file-system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 01:44 AM
04-01-2010 01:44 AM
Re: How to find opened file by NODE NUMBER
You were suppose to replace "file-system" by the correct file system mount point.
Matti suggested it was: /fwdev3/data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 01:45 AM
04-01-2010 01:45 AM
Re: How to find opened file by NODE NUMBER
I have tried for the scenario gien below and how can i find the mount point
cor 9354 fwsup01a 20u REG 3,0xa 0 6046739 /fwdev3/data (cbfp0004:/vol/fv_FUSD1_APP04954_cbs_pa_0/qt_FUSD1_APP04954_pa_fwdev3_0)
cbh10702 $ /usr/sbin/lsdev -e 3
Character Block Driver Class
2 3 fake pseudo
3 -1 mm pseudo
cbh10702 $ ll /dev/vg* | more
total 0
brw-r----- 1 root sys 64 0x000016 Nov 16 2007 UCPS
brw-r----- 1 root sys 64 0x00000d Oct 28 2008 agent10g
brw-r----- 1 root sys 64 0x000015 Nov 16 2007 condir
brw-r----- 1 root sys 64 0x000017 Nov 16 2007 ecc
brw-r----- 1 root sys 64 0x000014 Nov 16 2007 eco
brw-r----- 1 root sys 64 0x000013 Nov 16 2007 esm
crw-r----- 1 root sys 64 0x000000 Nov 16 2007 group
brw-r----- 1 root sys 64 0x000001 Nov 14 2008 lvol1
brw-r----- 1 root sys 64 0x00000a Nov 16 2007 lvol10
brw-r----- 1 root sys 64 0x00000b Nov 16 2007 lvol11
brw-r----- 1 root sys 64 0x000002 Nov 16 2007 lvol2
brw-r----- 1 root sys 64 0x000003 Nov 16 2007 lvol3
brw-r----- 1 root sys 64 0x000004 Nov 16 2007 lvol4
brw-r----- 1 root sys 64 0x000005 Nov 16 2007 lvol5
brw-r----- 1 root sys 64 0x000006 Nov 16 2007 lvol6
brw-r----- 1 root sys 64 0x000007 Nov 16 2007 lvol7
brw-r----- 1 root sys 64 0x000008 Nov 16 2007 lvol8
brw-r----- 1 root sys 64 0x000009 Nov 16 2007 lvol9
brw-r----- 1 root sys 64 0x00000c Oct 28 2008 oracle
brw-r----- 1 root sys 64 0x000010 Nov 16 2007 osmf
crw-r----- 1 root sys 64 0x000016 Nov 16 2007 rUCPS
crw-r----- 1 root sys 64 0x00000d Oct 28 2008 ragent10g
crw-r----- 1 root sys 64 0x000015 Nov 16 2007 rcondir
crw-r----- 1 root sys 64 0x000017 Nov 16 2007 recc
crw-r----- 1 root sys 64 0x000014 Nov 16 2007 reco
crw-r----- 1 root sys 64 0x000013 Nov 16 2007 resm
crw-r----- 1 root sys 64 0x000001 Nov 16 2007 rlvol1
crw-r----- 1 root sys 64 0x00000a Nov 16 2007 rlvol10
crw-r----- 1 root sys 64 0x00000b Nov 16 2007 rlvol11
crw-r----- 1 root sys 64 0x000002 Nov 16 2007 rlvol2
crw-r----- 1 root sys 64 0x000003 Nov 16 2007 rlvol3
crw-r----- 1 root sys 64 0x000004 Nov 16 2007 rlvol4
crw-r----- 1 root sys 64 0x000005 Nov 16 2007 rlvol5
crw-r----- 1 root sys 64 0x000006 Nov 16 2007 rlvol6
crw-r----- 1 root sys 64 0x000007 Nov 16 2007 rlvol7
crw-r----- 1 root sys 64 0x000008 Nov 16 2007 rlvol8
crw-r----- 1 root sys 64 0x000009 Nov 16 2007 rlvol9
crw-r----- 1 root sys 64 0x00000c Oct 28 2008 roracle
crw-r----- 1 root sys 64 0x000010 Nov 16 2007 rosmf
crw-r----- 1 root sys 64 0x000012 Nov 16 2007 rsched
crw-r----- 1 root sys 64 0x000011 Nov 16 2007 rxfer
brw-r----- 1 root sys 64 0x000012 Nov 16 2007 sched
brw-r----- 1 root sys 64 0x000011 Nov 16 2007 xfer
I didn't get this statement
Then use the output of "mount" or "bdf" to find out the mount point of that device.
how to use this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 02:04 AM
04-01-2010 02:04 AM
Re: How to find opened file by NODE NUMBER
really tnaks for the help now i can find where what is the file handle is opened
thanks alot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 03:59 AM
04-01-2010 03:59 AM
Re: How to find opened file by NODE NUMBER
You should be aware that an inode number is only unique within a filesystem. Hence, be sure to search for a file by inode number by explicitly restricting your search to the mounted filesystem in question. It is advisable to do something like:
# find /path -inum 1234 -exec ls -ld {} +
The '-xdev' argument prevents find() from crossing mountpoints.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 04:51 PM
04-01-2010 04:51 PM
Re: How to find opened file by NODE NUMBER
# find /path -inum 1234 -exec ls -ld {} +
>The '-xdev' argument
Yes, I ran into that when I was testing it. No need for -exec unless you were trying to show multiple files.
find /path -xdev -inum 1234
Then "ll -id" for the path you found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2010 12:17 AM
04-07-2010 12:17 AM