Different values output between du and df


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Different values output between du and df
# 1  
Old 01-29-2015
Different values output between du and df

Dear Gurus

I have a doubt:

Why df -h command shows me that /opt FS has used 3.0G:
Code:
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      9.7G  5.8G  3.5G  63% /
/dev/mapper/VolGroup00-LogVol05
                      226G  171G   45G  80% /var
/dev/mapper/VolGroup00-LogVol04
                      496M   19M  452M   4% /tmp
/dev/mapper/VolGroup00-LogVol03
                      496M  101M  370M  22% /home
/dev/mapper/VolGroup00-LogVol02
                       25G  3.0G   21G  13% /opt

but du -ch /opt shows me a Total of 49G

Code:
# du -ch /opt
...
94M    /opt/java/j2sdk1.4.2_12
477M    /opt/java
49G    /opt
49G    total

?

What is real amount of used space into /opt: 49G or 3G ?

Thank you so much in advance for your time and support.

Best regards,

Orma

Last edited by joeyg; 01-29-2015 at 04:55 PM.. Reason: Please wrap commands and data in CodeTags
# 2  
Old 01-29-2015
Something is certainly odd -- that filesystem only has 25 gigs available, there's no way the total could be 43. The df total isn't going to be wrong unless you have massive disk corruption anyway, so, 3 it is.

I wonder if your du is being tricked by multiple hard-links to the same thing. It could be counting some of the same files repeatedly. What's your system?
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 01-29-2015
Code:
# uname -a
Linux  2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/issue
CentOS release 5.2 (Final)


Last edited by Don Cragun; 01-29-2015 at 09:06 PM.. Reason: Add CODE tags again.
# 4  
Old 01-29-2015
Odd. I've checked, and GNU du specifically excludes hardlinked files.

I don't suppose you have any NFS-mapped folders in there, or something.

Try du -xch, the x to prevent it from stumbling into funny things like that.
This User Gave Thanks to Corona688 For This Post:
# 5  
Old 01-29-2015
Now it look better than before; thank you so much Corona688, you were right:

Code:
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      9.7G  5.8G  3.5G  63% /
/dev/mapper/VolGroup00-LogVol05
                      226G  171G   45G  80% /var
/dev/mapper/VolGroup00-LogVol04
                      496M   19M  452M   4% /tmp
/dev/mapper/VolGroup00-LogVol03
                      496M  101M  370M  22% /home
/dev/mapper/VolGroup00-LogVol02
                       25G  3.0G   21G  13% /opt


Code:
# du -xch /opt
4.2M    /opt/temp_jar
17M     /opt/RBTLucene
...
1.4M    /opt/java/j2sdk1.4.2_12/man
6.2M    /opt/java/j2sdk1.4.2_12/lib
94M     /opt/java/j2sdk1.4.2_12
477M    /opt/java
2.8G    /opt
2.8G    total
#

have a nice day.

Last edited by Don Cragun; 01-29-2015 at 09:10 PM.. Reason: Add CODE tags again!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find values within range and output

Dear All, I am stacked and I ask for your help. Briefly, I have two files, one like this one (file1): 1 101 5 1 102 6 1 103 2 1 104 9 1 105 10 2 301 89 2 302 4 2 303 13 2 304 34 2 305 1 and the other like this one (file2): 1 103 2 303well, what I am trying to do is obtain a... (2 Replies)
Discussion started by: giuliangiuseppe
2 Replies

2. Solaris

Asvc_t values in iostat output

Noticed that asvc_t values in iostat command outputs are mostly more than 100 in our previous iostat analysis. Also found the following detail from an alternate site IO Bottleneck - Disk performance issue - UnixArena ---- 1. asvc_t average service time of active transactions, in... (2 Replies)
Discussion started by: saraperu
2 Replies

3. UNIX for Dummies Questions & Answers

Maximum of the values from the output a query

Following is the output of a command ran inside the script: 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-02 5 2015-01-29-05-38-03 5 2015-01-29-05-38-03 5 2015-01-29-05-38-03 5 2015-01-29-05-38-03 5 2015-01-29-05-38-03 5... (8 Replies)
Discussion started by: Devendra Hupri
8 Replies

4. Shell Programming and Scripting

Sorting out unique values from output of for loop.

Hi , i have a belwo script which is used to get sectors per track value extarcted from Solaris machine: for DISK in /dev/dsk/c*t*d*s*; do value=`prtvtoc "$DISK" | sed -n -e '/Dimensions/,/Flags/{/Dimensions/d; /Flags/d; p; }' | sed -n -e '/sectors\/track/p'`; if ; then echo... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

5. Shell Programming and Scripting

Extract multiple values from a tnsping output

Hi all, Can anyone help with the following request? I need to extract HOST value, SERVICE_NAME and msec value from a tnsping output and append to a file. The tnsping output is typically as follows: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS =... (4 Replies)
Discussion started by: jonnyd
4 Replies

6. Shell Programming and Scripting

Is it possible to extract these values from the output

Hi, I would like to search based of "java" and "-Dplatform.home=" and store these two values in bash variables. ps -xef | grep <pid> wlsuser 15160 15144 0 Feb 20 ? 17:27 /app1/jdk150_07/bin/IA64N/java -server -Xms1536m -Dplatform.home=/app1/bea/weblogic92... (13 Replies)
Discussion started by: mohtashims
13 Replies

7. UNIX for Dummies Questions & Answers

why output consists of 3 values

Hi there if I have a file called an411 which contains the folowing information 152.78.74.111 "GET /datafeed.php HTTP/1.1" 200 2826 152.78.74.211 "GET /index.html HTTP/1.1" 200 1190 152.78.74.121 "GET / HTTP/1.1" 200 3000 and I want to ouput the number of bytes of the record that contains... (2 Replies)
Discussion started by: FUTURE_EINSTEIN
2 Replies

8. Shell Programming and Scripting

Store the output values in array

Hi, How to store the values in array from output result, EG: I have the result like this, ps, google, 1.txt, 1 sam, google, 2.txt, 2 These are the four values followed by comma in two sets. I need to store these values set by set. One set contains four values followed by comma. ... (2 Replies)
Discussion started by: KarthikPS
2 Replies

9. AIX

fr and sr (from vmstat output) values are very high

Hi AIX Expert, the fr (page freed/page replacement) and sr (pages scanned by page-replacement algorithm) values from the vmstat output (see below please) are very high. I usually see this high value during the oracle database backup. In addition, the page scan/page steal/ page faults values... (7 Replies)
Discussion started by: Beginer0705
7 Replies

10. Shell Programming and Scripting

assign values from awk output - help

Dear All, I have a command which gives the number of fields of each line of a comma-separated file. sthng like this : cat QDB_20071126_002.bad | awk -F"," '{ print NF }' I need to assign the first output and the last output of the above command to variables in a script. Need help to do... (4 Replies)
Discussion started by: KrishnaSaran
4 Replies
Login or Register to Ask a Question