System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

bdf shows file system full but a du –k shows space available

SOLVED
Go to solution
PamelaJThrasher
Regular Advisor

bdf shows file system full but a du –k shows space available

Hello
On my HP-UX 11.31 server, the DBA's had a file system that was getting full so they removed a bunch of files. a bdf of the file system shows that it is still almost full but a du –k shows a lot of space available.

I suspect that the DBA removed at least one file that was still being written to. I know in previous versions of HP-UX, the only way to recover this space was to reboot the server. Is that still true for 11.31?
6 REPLIES
Suraj K Sankari
Honored Contributor

Re: bdf shows file system full but a du –k shows space available

Hi,

Use lsof to see any open files are there

Suraj
Nido
Trusted Contributor
Solution

Re: bdf shows file system full but a du –k shows space available

Hi Pamela,

Check for the open files which are occupying the space using lsof.
Find and kill the process, you may get the free space.

eg. lsof +aL1 /Dir

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


Thanks,
" Let Villagers Be Happy!! "
James R. Ferguson
Acclaimed Contributor

Re: bdf shows file system full but a du –k shows space available

Hi:

Large descrepencies between 'du' and 'bdf' are symptomatic of an inuse file having been removed.

Disk space is not returned to the system until the last process using a file is closed. A common and valuable technique is to open a file; immediately unlink() (remove) it; and continue to use it for the duration of the process. When the process terminates, without further adieu, the used disk blocks are returned to the available pool.

THis is the way UNIX works and applies to any release.

I suggest you get 'lsof' from the Porting Center. This will allow you to see these "hidden" files. That is, once unlinked, you will not be able to see the file in a simple 'ls' listing. The 'lsof' utility will expose this, though as a file with a link count greater than zero.

Terminating the process(es) using the file is sufficient to return the space to the system. A reboot is a drastic way.

Regards!

...JRF...
Duncan Edmonstone
Honored Contributor

Re: bdf shows file system full but a du –k shows space available

This wasn't the case even for older versions of HP-UX - where did you get that idea from?

There's no need to reboot the server - all you need to do is figure out which processes had those files open and stop (kill) those processes.

So "fuser -c /filesystem" might give you a clue, but to really see which processes have "unlinked" files open you need to use lsof:

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

and then use:

lsof +aL1 /filesystem


HTH

Duncan

HTH

Duncan
PamelaJThrasher
Regular Advisor

Re: bdf shows file system full but a du –k shows space available

Thank you. I am running the lsof +aL1 against the file system as I am writing this.

And I got the idea that a reboot was needed to fix this problem because that is what is suggested in many other threads right here on the ITRC.
PamelaJThrasher
Regular Advisor

Re: bdf shows file system full but a du –k shows space available

I am running the command as suggested and redirecting the output to a file which I will send to the DBAs for them to review and kill the processes at their discretion.

Thanks again for all the help.