System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Used space of a file system is huge in the output of "bdf" command but less as per "du -sk"

youthsen
Occasional Advisor

Used space of a file system is huge in the output of "bdf" command but less as per "du -sk"

Hi All,

 

We have one file system called /appl having installed oracle on that...

 

1)As per "bdf":

 

/dev/vg00/lvol5    8593408 8128682  454678   95% /appl

 

2)As per "du -sk":

 

#du -sk /appl
2643686                       /appl

 

 

My questions:

 

1)What is the RCA for this issue / How to find?

 

2)Will it be resolved if we are running FSCK on that file system, what is the exact command syntax for fsck?

 

3)How to resolve the issue?


 

 

 

5 REPLIES
Pete Randall
Outstanding Contributor

Re: Used space of a file system is huge in the output of "bdf" command but less as per &qu

It's because of "sparse" files, where the space is allocated but not filled.  The bdf command counts that as used while the du command does not.  Running fsck will have no effect.

 

 

Pete


Pete
Robert Salter
Respected Contributor

Re: Used space of a file system is huge in the output of "bdf" command but less as per &am

Are you looking to reduce the amount of utilized space? Reduce the size from 95% utilized to something less? Have the DBAs check the /appl file system to see where the space is being used. Or you can do the same by drilling down into the file system to see where the space hogs live. Try doing this;

cd /appl

du -sk * | sort -rn | head

 

This will give you the 10 biggest items, if the iggest is a directory, then cd into that directory and run it again. A little time consuming but ... it works.

 

Beers!

Time to smoke and joke
Dennis Handly
Acclaimed Contributor

Re: Used space of a file system is huge in the output of "bdf" command but less as per

You have a huge open file(s) that someone has deleted.  Until the process exits, the space will be used.

You can use lsof to find the process and then you can decide if you want to kill it.

Someone deleted a huge logfile?

 

To run fsck(1m), you would have to kill that process anyway and that would solve the problem.

 

>Pete: It's because of "sparse" files, where the space is allocated but not filled.

Huh?  The definition of a sparse file is the space isn't allocated.

Otherwise sparse files only fool tar, cp, ll(1) and humans.  Not bdf nor du.

 

>Robert: you can do the same by drilling down into the file system

 

That won't find the missing 6 Gb.

Hakki Aydin Ucar
Honored Contributor

Re: Used space of a file system is huge in the output of "bdf" command but less as per &qu

lsof is great to solve issues like this. agree with Dennis.

also bdf and du is slightly different bdf show sometimes wrong due to  adeleted fiel and process that uses this file not finished yet. check this link:

http://h30499.www3.hp.com/t5/System-Administration/Differensies-in-output-of-bdf-and-du/m-p/4281029#M335460

youthsen
Occasional Advisor

Re: Used space of a file system is huge in the output of "bdf" command but less as per &am

Dear All,

 

The issue has been solved once we stop entire oracle and listener...

 

Thanks a lot for your support...