Operating System - HP-UX
1752781 Members
6022 Online
108789 Solutions
New Discussion юеВ

bdf shows more space utilization

 
hpuxadm1
Occasional Advisor

bdf shows more space utilization

Hello all,

Below is the output from bdf . Approx 1.7gb used.
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvora2 2457600 1802980 613793 75% /home/oracle
====================
Below is the actual space used with du command. approx 226mb.
/home/oracle#du -sk
226197 .

What may be reason for same & how to correct this.

5 REPLIES 5
Laurent Menase
Honored Contributor

Re: bdf shows more space utilization

when you have a large diff between du and bdf, and bdf is giving much more used, it is usually due to a still opened file which had been removed.
Until the process owning the fd to that file close the file, it will still be there, and can still grow.

for instance do a

# yes > /tmp/test &
# rm /tmp/test
bdf will show you the space in the fs growing
when du will give always the same value.
kill yes process and you will recover the space.

rariasn
Honored Contributor

Re: bdf shows more space utilization

Hi,

https://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1318877

The easiest way to recover this disk space is to stop the process(es) that have these files open.

rgs
Jim Walls
Trusted Contributor

Re: bdf shows more space utilization

If you don't have lsof, you can use the fuser command to find what pids may have attachments in the file system:

See man fuser

fuser -cu /home/oracle

That should give you a starting point as to what processes could be involved and help you decide which may need to be stopped.

Ishwar_1
Frequent Advisor

Re: bdf shows more space utilization


bdf provides the output of the mount points in %, On the other hand, du -sk shows the size of any directory in kilobytes.


There is a difference in how du and bdf behave.This may occur if we touch open files.

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

"bdf": It shows the free disk space available.

The difference is here: if a still-active process has allocated blocks (such as
a logfile that you've just deleted), "bdf" counts these as still occupied.
This won't change until the process using the open file are closed ("deallocates the blocks")
The free space will not be returned until the process holding the open file terminates (or atleast close the file).

Solution

1> First Check the Processes by
# fuser -cu /home/oracle
kill the unwanted process.

Or

2> To kill the process running on the /home/oracle
# fuser -cku /home/oracle

Or

3> restart the application using the /home/oracle

To see files and processes in this state use lsof as follows:

lsof +L1 | grep REG

if you don't have lsof, you can download it from:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.83/
SoorajCleris
Honored Contributor

Re: bdf shows more space utilization

Hi,

As our mates suggested, This happens becuase of unlinked files.

DU goes by directory structure and bdf goes by block level.

If you are not able to find unlinked files, other chance is

there are some data exist in directories which is used for mounting filesystems.

Is there any filesystem mounted over /home/oracle/xxxx??????

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie