General
cancel
Showing results for 
Search instead for 
Did you mean: 

The commands df and du indicate different amounts of available space

 
SOLVED
Go to solution
Highlighted
Bruno Rebelo Lobato
Occasional Advisor

The commands df and du indicate different amounts of available space

The commands du and df/bdf report inconsistentes information between itself. Basically, the commands indicate different amounts of available space.

See above:
### df -k /var ####
/var (/dev/vg00/lvol7 ) :
2420306 total allocated Kb
47021 free allocated Kb
2373285 used allocated Kb
98 % allocation used

### du -ks /var ###
1087060 /var

This is very strange and i need some help please, any of you know this problem ? know a patch or a solutions for this problem ?

Thank's

Bruno Lobato - Manaus - Brasil
2 REPLIES 2
Highlighted
Steven E. Protter
Exalted Contributor
Solution

Re: The commands df and du indicate different amounts of available space

The difference between bdf/df and du usually is from processes that have allocated diskspace but not yet used it.

Essentially there is a process that may is alive and thinks it has disk space, even if its parent has been killed. Kill the process, the space is released.

Tools:

fuser -cu /filesystem_name

lists processes by owner on a filesystem. Other options let you see the data in other ways.

fuser -cuk /filesystem_name

Big time dangerous, but it will kill all processes on a filesystem, releasing any space.

The typical scenario here is process 10233 is open with a hanle on file /tmp/mydata.dat

You erase the file with rm but the process is still open.

bdf reports the space used, du reports it free. Both are kinda right.

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
Highlighted
Jean-Luc Oudart
Honored Contributor

Re: The commands df and du indicate different amounts of available space