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
James R. Ferguson
Acclaimed Contributor

Re: fs size reporting


You need to download and install 'lsof':

# lsof +D /path +L1

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


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
Honored Contributor

Re: fs size reporting


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


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.


VK2COT - Dusan Baljevic
Steven E. Protter
Exalted Contributor

Re: fs size reporting


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.

Steven E Protter
Owner of ISN Corporation