Operating System - HP-UX
1833958 Members
1762 Online
110063 Solutions
New Discussion

df -k and bdf do not show the same total

 
Joseph Hoh
Frequent Advisor

df -k and bdf do not show the same total

Why does df -k and bdf show different totals on JFS file systems? The used and avail outputs seem to be the same and the df -k total seems to add up while the bdf total seems to be higher?
5 REPLIES 5
Rodney Hills
Honored Contributor

Re: df -k and bdf do not show the same total

This question has come up before in the forum and the basic answer is that df and bdf look at different ways of determining "free" file space.

If you look at the man page for bdf, it states
"Non-HFS file systems may have other items not accounted for by this command."

-- Rod H


There be dragons...
Steffi Jones_1
Esteemed Contributor

Re: df -k and bdf do not show the same total

Hi Jeff,

sometimes files get deleted and are still in use and then the kernel doesn't release the space.

Check if a reboot will clear up the differences if you have a maintenance window.

Steffi Jones
Bill Hassell
Honored Contributor

Re: df -k and bdf do not show the same total

df/bdf do not account for any disk space used
by the underlying file system structures such as the superblock, cylinder blocks, inodes and so on. Swap space usage is only reported with the -b option.

bdf will show inconsistent results for VxFS mount points versus the corresponding device file. For the HFS filesystem, inodes and
superblocks are preset via newfs but for the Journaled File System there are no fixed inode allocations. Instead, VxFS filesystems
consist of a number of dynamic attributes that describe the filesystem. These dynamic attributes are called structural files and they are kept in a separate fileset (Fileset 1) from the user files (Fileset 999).

Since these structures are dynamic and can grow as more files are added to the filesystem, it is impossible to determine how much space will be used used by structural files and how much space will be used by user files. Unlike an HFS filesystem, where all the inodes are preallocated when the filesystem is created, a VxFS filesystem can continue to allocate more inodes as needed. However, each time a new block of inodes is allocated, the number of actual data blocks are
reduced.

So bdf and du must guess as to the number of inodes that might be needed and the space available. The bdf 'used' column represents
space used by both user files and structural files. The bdf 'avail' column represents the Kbytes available after subtracting the actual Kbytes used and the estimated Kbytes needed for inodes.


Bill Hassell, sysadmin
federico_3
Honored Contributor

Re: df -k and bdf do not show the same total

Hi

df reports the total size minus the 'minfree %'
bdf reports the total size

bdf_total * (100 - minfree %) = df_total



Federico
Bill McNAMARA_1
Honored Contributor

Re: df -k and bdf do not show the same total

Have a look at this link which should explain at least one possible reason for tis happening..
Ignore my replies!!

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

Later,
Bill
It works for me (tm)