1833873 Members
1769 Online
110063 Solutions
New Discussion

File system usage

 
SOLVED
Go to solution
M.Thomas
Frequent Advisor

File system usage

Dear Admins,
In one of the hpux server, filesystem is increasing frequently
In bdf output it showing 178768kb used
If I use du â sk , its showing 8637, can any one tell me why the difference & how to fix the issue , in vgdisplay output I am to see 1PE=16mb
Here I attach the bdf output

root /usr/local/mqm > du -sk * | sort -rn
7235 log
845 bin
419 c
89 dat
44 bkup
3 stage
1 diff
0 lost+found
root /usr/local/mqm > bdf .
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol9 262144 178768 78289 70% /usr/local/mqm
root /usr/local/mqm > du -sk
8637 .

Please help me how to fix this
Thanks in advance

Regards
Thomas

5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: File system usage

Hi Thomas:

This is probably a case of a process that has created a temporary file; immediately unlinked (removed) it; and it continuing to write to it.

This is a common technique. The disk space allocated to the file will not be released back to the system until the link count of the file is decremented to zero and the last process associated with the file terminates.

You can use 'lsof' [available from the HP-UX Porting Center] to find the process(es) in question.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: File system usage

Because bdf and du are measuring different things. Bdf examines things from the perspective of the filesystem whereas du examines things from the perspective of the directory tree --- and those are very different things.

The most common difference is temporary files. Consider a process that open()'s a file, e.g. mytempfile and then immediately unlink()'s it without doing a close(). The directory entry for mytempfile has been removed but the space used is not returned to the filesystem until the file is close()'ed or until all processes which had the file open terminate. This is a very standard idiom for temporary files in UNIX and because the file is not visible to du but the space used is visible to bdf, the two utilities report very different values. Another difference is sparse files.
If it ain't broke, I can fix that.
Sandman!
Honored Contributor

Re: File system usage

Most likely a file that has been deleted but is still held open by a process. So until the process terminates the space will not be reclaimed. There are countless threads that discuss the discrepancy between bdf and du and to resolve this issue use lsof which can be obtained from HP's porting and archive center...http://hpux.cs.utah.edu

~cheers
M.Thomas
Frequent Advisor

Re: File system usage

Dear All,

Thanks for your quick response,please tell me how find open files using lsof
James R. Ferguson
Acclaimed Contributor

Re: File system usage

Hi (again) Thomas:

Manpages accompany 'lsof' and/or are available on the web (use Google to search).

# lsof +D /path +L1

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

Regards!

...JRF...