Operating System - HP-UX
1832234 Members
2564 Online
110041 Solutions
New Discussion

df -k and du -ks output is not matching

 
SOLVED
Go to solution
Guna_2
Regular Advisor

df -k and du -ks output is not matching

Hi all,

I received a error message from my solaris box as file system 90% full. But when i checked the original utilization of files it varies from the df output.

# df -kh /log
Filesystem size used avail capacity Mounted on
/dev/dsk/c1t0d0s6 3.8G 3.4G 412M 90% /log


# du -khs /log
308M /log

the filesystem is UFS. I think it requires to defrag.

Please suggest me

Thanks and Regards
--MGP--
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: df -k and du -ks output is not matching

Shalom,

defragging the filesystem is a good idea. It has nothing to do with this issue.

Unix and Linux do not release space back to the system for re-use until two things happen. The file is deleted and any file handles open on the file are closed.

These discrepencies come from two major areas.
1) Inconsistencies in the writing of the reporting utility.
2) Files deleted without file handles being closed.

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
Guna_2
Regular Advisor

Re: df -k and du -ks output is not matching

Hi Sep,

I dont have much idea about UFS. I am basically from HP platform.

Is it possible to do online defragmentation in UFS?

Can u please tell me the procedure also to do the same?

Thanks and Regards
--MGP--
spex
Honored Contributor

Re: df -k and du -ks output is not matching

1) This is an HP-UX forum, not a Solaris forum. What's more, there are many more Solaris forums in existence than HP-UX forums, so you'd be well-advised to look into them:

http://www.solarisforums.com/news.php
http://supportforum.sun.com/
http://forum.java.sun.com/index.jspa?tab=solaris
http://www.opensolaris.org/jive/index.jspa?categoryID=1

2) Regardless of UNIX flavor, this is one of the most common questions that comes up on the ITRC forums. A file has been unlinked (deleted), but one or more processes still have it open. Kill the offending process(es), if safe to do so, and 'df' will report the correct utilization. 'lsof' will help you investigate.

PCS
Peter Godron
Honored Contributor

Re: df -k and du -ks output is not matching

Guna_2
Regular Advisor

Re: df -k and du -ks output is not matching

Thanks,

--MGP--