Operating System - HP-UX
1837118 Members
2308 Online
110112 Solutions
New Discussion

bdf and df -k give different results for total available

 
SOLVED
Go to solution
Martin Johnson
Honored Contributor

bdf and df -k give different results for total available

Can anyone explain why the total available space is different for bdf and df -k?

Here is an example:

bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 147456 49873 91722 35% /

df -k /
/ (/dev/vg00/lvol3 ) : 141595 total allocated Kb
91722 free allocated Kb
49873 used allocated Kb
35 % allocation used

91722+49873=141595 How come bdf reports 147456?

Thanks
Marty
7 REPLIES 7
PIYUSH D. PATEL
Honored Contributor

Re: bdf and df -k give different results for total available

Hi,

du shows the number of currently allocated blocks and counts the blocks you've just deleted as free.

bdf shows the free disk space available.

The difference is that if a active process has allocated blocks eg for a logfile that you've just deleted "bdf" counts these as still occupied. This wont change until the process closes the file ("deallocates the blocks") as it usually happens when the process terminates.

du adds up all the files and then shows the results. Hence the size shown bu du will be less.

Piyush
Martin Johnson
Honored Contributor

Re: bdf and df -k give different results for total available

Piyush,

I am using the "df" command, not "du".

Marty
PIYUSH D. PATEL
Honored Contributor

Re: bdf and df -k give different results for total available

Hi,

Sorry !!!

df reports the total size minus the 'minfree %'

bdf reports the total size

bdf_total * (100 - minfree %) = df_total

df -t - gives the % minfree


HTH
Piyush


Martin Johnson
Honored Contributor

Re: bdf and df -k give different results for total available

True, but minfree is for HFS file systems, the default is 10%. This explains the difference in /stand (which I checked on this system is 10%). However, / is vxfs, and the difference is 4%. Why this difference?


Marty
PIYUSH D. PATEL
Honored Contributor
Solution

Re: bdf and df -k give different results for total available

Hi,

yes you are right.....

There have been lot of questions regarding this in the forums.

Pls go thro this link...it may explain you in much details....

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x81ac72234586d5118ff00090279cd0f9,00.html

Piyush
Martin Johnson
Honored Contributor

Re: bdf and df -k give different results for total available

Leave it to Bill to come up with the answer. Too bad he didn't get any point for it.


Marty
PIYUSH D. PATEL
Honored Contributor

Re: bdf and df -k give different results for total available

Hi Marty,

True !!!

Lots of hidden fundas in HPUX.

Piyush