Operating System - HP-UX
1834089 Members
2268 Online
110063 Solutions
New Discussion

Improper disk space reporting using "bdf" and "du".

 
Sameer S
Advisor

Improper disk space reporting using "bdf" and "du".

Hi,
I am facing a strange problem. When I do a "bdf" , /opt shows as 100% full (4GB). But when I do a "du -sk /opt", it shows lesser space (2.4GB). What can be the problem? I am using HPUX 11i on B2000 workstation.
Please help...
Let us grow our knowledge by sharing ...
4 REPLIES 4
H.Merijn Brand (procura
Honored Contributor

Re: Improper disk space reporting using "bdf" and "du".

Sparse files?
Pipes?

Whatever, try 'sync' first, and then bdf again.

Even better: get 'di' *the* replacement for bdf and df. Available from http://www.gentoo.com/di/ or precompiled from https://www.beepz.com/personal/merijn/#Downloads
Enjoy, Have FUN! H.Merijn
Christian Gebhardt
Honored Contributor

Re: Improper disk space reporting using "bdf" and "du".

a typical reason is that you have files "under a mountpoint"

so for example
/opt/mountpoint
is a mounted filesystem but in /opt/mountpoint are files before you have mounted the lvol.
You don't see these files with "ls" or "du" but bdf noticed the occupied space.

Chris
Animesh Chakraborty
Honored Contributor

Re: Improper disk space reporting using "bdf" and "du".

Hi,
May be some process holding that space.
If possible just unmount and mount /opt (in single user mode)
#fuser -cu /opt
#fuser -k /opt (it will kill all process)

But bdf and du output will never be the same

//quote from Bill hassell//
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.

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

Did you take a backup?
Sameer S
Advisor

Re: Improper disk space reporting using "bdf" and "du".

Hi All,
Problem resolved!!
It had something to do with the mounting. I think, unmounting and remounting the /opt could have solved the problem. But as it was in init4, could not unmount /opt. Rebooted the server, and after restart, the system reports proper disk space utilisation with "bd" and "du".
Thanks all for your time and efforts!!
Let us grow our knowledge by sharing ...