cancel
Showing results for 
Search instead for 
Did you mean: 

fs size reporting

 
Michael Murphy_2
Frequent Advisor

fs size reporting

Hello - i am having an issue where we believe a log file was "zeroed out" (>file) in the /tmp directory - but that a process still has the space reserved due to an open file descriptor. The bdf is showing 98% full but du does not show near full - we have seen this before and usually can locate the process and kill. This time we can't seem to locate - is there a way to find the process or list the true size of the file (ls -l seems to still show zero) thanks
4 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: fs size reporting

Hi:

You need to download and install 'lsof':

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

# lsof +D /path +L1

...will list open, unlinked files in /path.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: fs size reporting

If the file still exists you can try:

# fuser -u /tmp/filename

or if you have lsof:

# lsof -f -- /tmp/filename
VK2COT
Honored Contributor

Re: fs size reporting

Hello,

Classical problem that often happens :)

a) If you do not know the name of the
log file, simply check all open files in /tmp:

# fuser -cu /tmp

Or,

b) If you know the name of the file:

# fuser /tmp/mylogfile

Even more powerful is open-source tool lsof.
It can do excellent job in finding open or
unlinked files.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Steven E. Protter
Exalted Contributor

Re: fs size reporting

Shalom,

If you delete the contents of a file, while there is still an open file hand on it, the space is not returned and does not show free.

As noted above fuser -cu will display you the process id's. From there you can determine the process that needs to be killed or bounced in orded to get the space back.

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