Operating System - HP-UX
1830865 Members
2359 Online
110017 Solutions
New Discussion

why bdf & du display two different results

 
王曦_1
Occasional Advisor

why bdf & du display two different results

hi expert,
i found my /opt is 100% full by bdf command, and i could not copy any file to this filesystem, but when i use df -sk, i found the filesystem only 67% full, how can i do
thanks
8 REPLIES 8
Rajeev  Shukla
Honored Contributor

Re: why bdf & du display two different results

your /opt might be full because of inodes too.

best it to unmount and mount /opt again that will help or reboot the system if its not critical and if it so take an outage and then do it.
/opt being full wont anyway bother your normal execution of machine.

Rajeev
Michael Tully
Honored Contributor

Re: why bdf & du display two different results

Have you attempted to remove some largefiles?

These files could still have some processes open and that is why the report is incorrect.

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
Anyone for a Mutiny ?
Steven E. Protter
Exalted Contributor

Re: why bdf & du display two different results

If there are open processes on files you recently deleted, bdf will show the filesystem is full even though you just deleted a bunch of files.

du will show the space as clear.

Since /opt is not such a critical filesystem, you can clear this without a boot.

fuser -cu /opt

to identify the processes.

fuser -cuk /opt to just go ahead and kill all open processes on /opt

After running the second command, bdf and du -sk should show similar results.

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
V.Tamilvanan
Honored Contributor

Re: why bdf & du display two different results

Hi,

When a process writes to a file if you have removed that file forcefully before that file closed by that process, you see the difference between bdf and du -sk.
The information is updated immediately to the du -sk but not to bdf.
If you restart your server the bdf output will be updated properly.
Check by using lsof whether any process writes to the /opt FS and you can kill that process. By doing this also ur bdf may get updated.
HTH
V.Tamilvanan
Honored Contributor

Re: why bdf & du display two different results

twang
Honored Contributor

Re: why bdf & du display two different results

du shows the number of currently allocated blocks.
bdf shows the free disk space available.

The difference is because bdf cannot see the blocks "occupied" by a still active process.
bdf will see the change until the process terminates.
Helen French
Honored Contributor

Re: why bdf & du display two different results

The questions regarding bdf and du has been answered almost every day! Please do a search on the forums (now on top of the screen) and find the best solution available for you.
Life is a promise, fulfill it!
Caesar_3
Esteemed Contributor

Re: why bdf & du display two different results

Hello!

The bdf and du work on diffrent system calls
So if one proccess write to that file system
with du you would see the size that it take
and with bdf you will see.

Also see in man about the block size that
the command show the size.

Caesar