Operating System - HP-UX
1834130 Members
2259 Online
110064 Solutions
New Discussion

Differensies in output of bdf and du

 
SOLVED
Go to solution
Maxim Yakimenko
Super Advisor

Differensies in output of bdf and du

Dear collegues

Can one explain why bdf differs with du?

I have filesystem made on LVM LV

bdf shows that:

size 661520384 kbytes
used 380609243 kbytes
avail 263354293 kbytes

the most size used is Oracle archive logs
there ~90 files of 2 Gb - it is ~180Gb

du shows the same 180 Gb

ll also shows that files are of 2Gb size and manual calculation gives the same 180 Gb

HPUX 11.23

What it can be?
10 REPLIES 10
Ivan Krastev
Honored Contributor
Solution

Re: Differensies in output of bdf and du

The reason is some unlinked files. See this previous thread - http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=664105


regards,
ivan
Jeeshan
Honored Contributor

Re: Differensies in output of bdf and du

bdf - report number of free disk blocks
du - summarize disk usage

where did u execute the du? in mount point or a particular folder within a file mount point?


anyway, sometimes it observes that, file system may still hold the released file(s). check which file(s) are now being accessing in that mount point with lsof.

#lsof +aL1 /
a warrior never quits
Maxim Yakimenko
Super Advisor

Re: Differensies in output of bdf and du

Ivan, yes, I see, according search result this is very popular question :) and often replies mention open but deleted files

ahsan, I tried du on mountpoint and on specific dir within mountpoint

Collegues, do you know any precendents with Oracle? This filesystem is used as storedge for Oracle archive logs.

Also, as I understand I should try to unmount it in oder to be sure that no one uses open but deleted files in this fs?
Maxim Yakimenko
Super Advisor

Re: Differensies in output of bdf and du

ahsan, I tried lsof as you said

all his output is just strings like this

oracle 564 oracle 413u REG 64,0x280001 33286004736 0 47 /u18 (/dev/vgarcl/lvol1)

total 431 strings that show that different oracle process hold /dev/vgarcl/lvol1

total existing files on that filesystem is 154

does this show that I have a lot of unlinkeds?
Jeeshan
Honored Contributor

Re: Differensies in output of bdf and du

yes, you can see the lsof output. if you go through all of its output lines, you can see, which files are still be accessed and that is not really exits in your mount point.
a warrior never quits
Maxim Yakimenko
Super Advisor

Re: Differensies in output of bdf and du

all 430 strings has 0 in NLINK field

So, how can I clear them? Should I try to unmount this FS or reboot of server is more correct solution?

Jeeshan
Honored Contributor

Re: Differensies in output of bdf and du

but before restart the server first stop the database completely and then unmount that mount point.
a warrior never quits
Maxim Yakimenko
Super Advisor

Re: Differensies in output of bdf and du

Well, usually I stop DB before reboot :)

Thanks :)
Steven E. Protter
Exalted Contributor

Re: Differensies in output of bdf and du

Shalom,

These two utilities use different means to obtain space.

BDF will not show free space until file handles are closed on deleted files. A common cause of discrepancy is a file handle is open on a deleted file and the space is recognized by du and not bdf.

example:
I rm /tmp/bigfile.dbf
Its 200 GB.

But its an oracle database and oracle is running and has an open file handle.

fuser -cu /tmp
Will show an open process and file handle

fuser -cuk will kill that process. But if in my example that will bring down the oracle database so you must use this command with extreme caution.

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
Heironimus
Honored Contributor

Re: Differensies in output of bdf and du

The correct answer is not to umount or reboot. You can't umount because there are open files so the filesystem is in use. You don't need to reboot because the space will be freed as soon as the process closes the files (like when it exits). lsof shows the PIDs, so you should be able to determine who has the files open and ask the appropriate people to take a look at it.