Operating System - HP-UX
1850102 Members
2910 Online
104050 Solutions
New Discussion

"df -b" vs "df -k" vs bdf

 
Rashid Ali
Frequent Advisor

"df -b" vs "df -k" vs bdf

Anybody knows what's the difference between df -b and df -k? How come the free space is different in these two output?

Thanks,

# bdf /home
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol4 79701 58345 13385 81% /home
# df -b /home
/home (/dev/vg00/lvol4 ) : 21356 Kbytes free
# df -k /home
/home (/dev/vg00/lvol4 ) : 71730 total allocated Kb
13385 free allocated Kb
58345 used allocated Kb
81 % allocation used
1 REPLY 1
Praveen Bezawada
Respected Contributor

Re: "df -b" vs "df -k" vs bdf

Hi
df -b reports the number of kilobytes free
df -k reports the allocation in kilobytes( calculates free as total - used )
sometimes there is inconsistency between the two when say, some file has been deleted but there still exist some file handlers accessing that file.
Suppose a process writes into a file and you have deleted the file. The space allocated to the file is released but as long as the process accessing the file exists the space is not totally free. This has been a recurring problem when we run our applications in a debug mode. The log gets large filling up the entire file system and when we delete the file manually df -b ,df -k and du show different values. Only we stop our application, the commands show the same values.
Something of this kind may be happening about your place.
Hope this helps.

...BPK...