disk usage (df vs du) | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

disk usage (df vs du)

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-02-2006
gfhgfnhhn gfhgfnhhn is offline
Registered User
 
Join Date: Mar 2006
Last Activity: 16 April 2007, 6:07 AM EDT
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Error disk usage (df vs du)

displaying the disk usage using df
and displaying the disk usage using du -sk
gives me different results:

1st case: df -k |grep users

2nd case: cd /users; du -sk

sometimes this difference is 50 gigabyte!!!
do you have any idea about this situation?
Sponsored Links
    #2  
Old 08-02-2006
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 23 November 2014, 5:03 PM EST
Location: Saskatchewan
Posts: 19,912
Thanks: 845
Thanked 3,416 Times in 3,201 Posts
You are aware that 'df' only reports usage stats on filesystems, yes? 'du', on the other hand, measures directory contents.
Sponsored Links
    #3  
Old 08-03-2006
gfhgfnhhn gfhgfnhhn is offline
Registered User
 
Join Date: Mar 2006
Last Activity: 16 April 2007, 6:07 AM EDT
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
disk storage is used for what else than directory contents?
    #4  
Old 08-03-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
AFK
 
Join Date: Dec 2004
Last Activity: 28 July 2014, 9:39 AM EDT
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
Is there just one mount point that has the word "users" as part of the filename?
Check the output for my system:

Code:
# cd /netbackup
# df -k |grep netbackup
/dev/vx/dsk/sysdg/netbackup 1536000 1439224   96080    94%    /netbackup
# du -sk .
1422240 .

The difference is 1439224 - 1422240 = 16984 (and this is in KB). You should not be getting difference of 50GB or so... can you post the actual outputs?
Sponsored Links
    #5  
Old 08-03-2006
gfhgfnhhn gfhgfnhhn is offline
Registered User
 
Join Date: Mar 2006
Last Activity: 16 April 2007, 6:07 AM EDT
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
currently i cannot post actual output as we dont have this problem now.
we killed almost all the processes running on the machine,
to be able to make some links to another disks.
right after killing the processes we observed that,
output of df , rapidly decreased and came to a value very close to
output of du.
this may be a coincidence.
but another possibility is that the processes may allocate some temporary space
in the disks, because there were lots of long-time running processes which are doing heavy operations on database and also on unix files.
does it make sense?

i will send the actual outputs if the problem occurs again.

thanks for your concern...
Sponsored Links
    #6  
Old 08-03-2006
gfhgfnhhn gfhgfnhhn is offline
Registered User
 
Join Date: Mar 2006
Last Activity: 16 April 2007, 6:07 AM EDT
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
currently we have 0.7 gigabyte difference:

root@london:/> cd /users
root@london:/users> du -sk
70384708 .
root@london:/users> df -k| grep /users
DGC051#fs2 108000000 71011701 36988299 66% /users
root@london:/users>
Sponsored Links
    #7  
Old 09-22-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 17 October 2014, 8:46 PM EDT
Location: On my motorcycle
Posts: 3,093
Thanks: 1
Thanked 32 Times in 9 Posts
See this link - differences between du and df
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
current CPU usage, memory usage, disk I/O oid(snmp) S_venkatesh Solaris 2 12-13-2008 06:19 AM
disk usage tjay83 Shell Programming and Scripting 5 09-04-2008 10:34 AM
Disk Usage harikamamidala Shell Programming and Scripting 4 08-16-2007 03:22 PM
Disk usage (Mac OS 10.4) H1tokori UNIX for Dummies Questions & Answers 5 12-05-2005 07:37 PM
disk usage asutoshch UNIX for Dummies Questions & Answers 4 04-01-2001 09:02 AM



All times are GMT -4. The time now is 02:43 AM.