Operating System - HP-UX
1830143 Members
20919 Online
109999 Solutions
New Discussion

Running Processes using which FileSystem

 
SOLVED
Go to solution
Fuad_1
Regular Advisor

Running Processes using which FileSystem

Hi,

I have a requirement to know what filesystem are locked/used by which procesess? I know the process name, how I can know, what filesystem bieng used by this process?

Thanks.
Set goals, and work to achieve them
10 REPLIES 10
Ranjith_5
Honored Contributor

Re: Running Processes using which FileSystem

Hi Fuad,

try the following.

#fuser -cu /

this will give you the process ID and the corresponding user.

after this you can do
#ps -ef|grep to find the process details.

regards,
Syam
Fuad_1
Regular Advisor

Re: Running Processes using which FileSystem

Thanks Syam,

I know this command, but it does not help, as I have to run the command on every FS to see which processes are used. I want the reverse, giving process name/id, and get the FS used.
Set goals, and work to achieve them

Re: Running Processes using which FileSystem

Hi,

You need lsof:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.73/

This does exactly what you require.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Patrick Wallek
Honored Contributor
Solution

Re: Running Processes using which FileSystem

You can also get this information with Glance.

If you are using the character mode glance, you do a F (capital F), enter the PID number and you see all open files for that process.

If you are using the GUI version, you go to Report -> Process List. Then in the process list window you select the process you want and then go to Reports -> Open Files and you will then see all open files for the process.
Thierry Poels_1
Honored Contributor

Re: Running Processes using which FileSystem

Hi,

have a look at "lsof -p" or else use Glance.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
KapilRaj
Honored Contributor

Re: Running Processes using which FileSystem

lsof lsof lsof .... thats it

lsof -p # Will show all the open files by that process

Regds,

Kaps
Nothing is impossible
Fuad_1
Regular Advisor

Re: Running Processes using which FileSystem

Thanks to all for support, I have used Glance, which gives me the required details. But, I wonder, why lsof command is not defined in the system.
Set goals, and work to achieve them
Thierry Poels_1
Honored Contributor

Re: Running Processes using which FileSystem

hi,

lsof is not a standard hpux tool. You'll need to download & install it.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.73/

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Joseph A Benaiah_1
Regular Advisor

Re: Running Processes using which FileSystem

Faud,

In addition to using glance and lsof to show you the processes that are using a filesystem, the command fuer will do the same.

On files, running fuser -u will show the processes and the owner that are using the file. On a filesystem, running fuser -cu will show which processes with the owner are using the file system.

Cheers,

Joseph.
Fuad_1
Regular Advisor

Re: Running Processes using which FileSystem

Glance option work with me. Thanks to all
Set goals, and work to achieve them