Operating System - HP-UX
1833875 Members
1754 Online
110063 Solutions
New Discussion

df -k freespace details seems to be not accurate !!

 
ezhilarasan_1
Occasional Advisor

df -k freespace details seems to be not accurate !!

Hi,

df -k freespace details seems to be not accurate !!

This is common to any Unix.
I got the below output by df -k command.

df -k | grep sbc

Filesystem Total Used Available Use% Mounted on
/dev/emcpowerc1 157282400 138630240 18652160 89% /sbcdata/01/oradata

This means approximately Total filesystem size is 157 GB, used is about 138 GB and free is about 18 GB.

But I tried to create a datafile of size 10GB, it gave error "No space left".
That mean df -k info or my understanding seems to be not accurate.

Please help me how to calculate accurate freespace ( or Total, used ) info.

Thanks
Ezhil

3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: df -k freespace details seems to be not accurate !!

Several things can cause this: 1) This is an hfs filesystem and the minfree value (by default 10%) has been reached. 2) Quotas (doubtful). 3) df -k is a moment in time so that the actual remaining space was less. 4) Use lsof to see if any processes have this filesystem is used. Even after a rm (more accurately an unlink(), the space is not actually freed until the link count reaches 0 and all processes which had a file open with close() the file or terminate.

You will sometimes see significant differences in the output of du -k and df -k.
If it ain't broke, I can fix that.
TwoProc
Honored Contributor

Re: df -k freespace details seems to be not accurate !!

Were you perhaps creating files in an area that has Oracle temporary data files (or maybe undo or rollback)? If memory serves me correct, Oracle temporary files can be sparse(or at least sparse-like), meaning a 2G file can take up less than 2G at first, and kind of grow into it. I may be getting this mixed up in my mind with undo or rollback, but I'm pretty sure I remember temporary tablespaces.

In either case, I think what could be happening here is that the O/S knows that the space could be spoken for at some time in the future (which is really nice), and is keeping you from using it.

Oracle Temp space is kinda funny like that, it doesn't like to be copied very much, and it looks funny until the database actually allocates all the segments at one time or another and uses them. Once segmented and used, they represent their full size, but they are disconcerting to look at for a while.
We are the people our parents warned us about --Jimmy Buffett
Sandman!
Honored Contributor

Re: df -k freespace details seems to be not accurate !!

Try using lsof, its available at...

http://hpux.connect.org.uk

usage:
# lsof +aL1 /sbcdata/01/oradata

If the above command produces a report then space released from deleted files has not been recovered by the OS and your best bet is to recycle all the applications that are using this mount point.

cheers!