Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

df -k showing wrong usage comapred to du -sk

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
0
0
GB
Hi

We have moved some datafiles of mountpoint called /PREPROD to /u05/PREPROD

df -k on /PREPROD is showing usage as:- /dev/vx/dsk/PREPROD/preprod
419389440 386012209 31291264 93% /PREPROD

But the usage is only the follownig when we do a du -sk /PREPROD
278093290 /PREPROD

Any ideas.


Sy UK
 
du won't report open files size, df does do
 
the usage is incorrect as we moved approx 100gig of files from this mountpoint to the /u05/PREPROD mountpoint, but yet the /PREPROD mountpoint did not reflect the new usage once we removed the files.





Sy UK
 
well give it a go sunny and let ya know .. cant do yet as users on db.



Sy UK
 
The [tt]-k[/tt] option of [tt]df[/tt] is not reporting all available space on the filesystem. It's reporting space available to unprivileged users. When a filesystem is set up, you define a percentage of the space that is off limits to normal users (see the "[tt]-m free[/tt]" option of [tt]newfs[/tt]). This "off limits" space gets added to the [tt]used[/tt] column, even though it might not actually be used. So, the [tt]used[/tt] column is all of the space actually used, plus all of the "off-limits" space that only privileged users can use.

The off-limits space is so you can hit 0% free on a filesystem like [tt]/[/tt] (as reported by [tt]df[/tt]), but the OS doesn't crash (yet) because the OS still has a little space to use. It gives you a few moments to savor the adrenalin while you hunt for files to kill.

You can see the discrepency within [tt]df[/tt] too. Try both the [tt]-b[/tt] option and the [tt]-k[/tt] option (separately, not together). The [tt]avail[/tt] column for the [tt]-b[/tt] should be ALL available space. The [tt]avail[/tt] column for the [tt]-k[/tt] should be only space that normal users can use.

If you do a "[tt]du -dks /PREPROD[/tt]" and add that to the value given by "[tt]df -b /PREPROD[/tt]", it should come closer to the total filesystem size given by the "[tt]df -k[/tt]" command.

Is this clear or did I just confuse things?

Hope it helps.
 
Also, the [tt]du[/tt] command doesn't report directories it can't get into and files it can't open. Add the [tt]-r[/tt] option to see where it can't get to. This is more usage that [tt]du[/tt] can't report that does show up in the [tt]df[/tt] total.
 
PROBLEM NOW SORTED..

SHUTDOWN THE DATABASE AND BROUGHT IT BACK UP....

DID A DF -K NOW SHOWING 71%:-

# df -k /PREPROD

/dev/vx/dsk/PREPROD/preprod
419389440 291603965 119798994 71% /PREPROD

Sy UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top