1829637 Members
1655 Online
109992 Solutions
New Discussion

Re: open files

 
SOLVED
Go to solution
Alistair Tonner
Occasional Advisor

open files

when a process was dumping data to a file in / file system, the file was deleted.
"bdf /" and "du -ksx /" show a big difference of 120MB about space used. How to know which process was writing to the deleted file? How to get the space back?
It is not kown if the saying "May you live in interesting times." is a curse or blessing. My life is interesting.
6 REPLIES 6
John Poff
Honored Contributor

Re: open files

Hi,

The process is still running and still writing to the disk even though the file was deleted. If you have Glance installed you can use it to try to find the process holding open the file, but a better tool would be lsof. Try the HP-UX Porting Center to get a copy of lsof.

JP
John Poff
Honored Contributor

Re: open files

I forgot to add that once you find the process writing to the file, you can just terminate it or kill it and your space should be freed up.

JP
Steven E. Protter
Exalted Contributor

Re: open files

You can kill all the processes on a filesystem as follows:

fuser -cuk /fs_name

Use with caution, you can bring down your machine if you're not careful.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alistair Tonner
Occasional Advisor

Re: open files

The file was deleted in fear of root file system full. We do have "lsof" utility installed. However, without file name, without knowing which process, how can we identify cause they are so many open files in root file system. The file deleted was a core file.
It is not kown if the saying "May you live in interesting times." is a curse or blessing. My life is interesting.
John Poff
Honored Contributor
Solution

Re: open files

Hi,

Try running lsof and see what you get in the Name column. It normally lists the name of the open file, but I'm guessing that it will list the filesystem/logical volume and inode number for the process with the deleted, which should be a hint.

JP
Michael Steele_2
Honored Contributor

Re: open files

lsof -p pid
lsof -u uid
lsof /file_system

Man 'lsof' :

http://hpux.cict.fr/hppd/hpux/Sysadmin/lsof-4.64/man.html
Support Fatherhood - Stop Family Law