LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-21-2007, 06:29 AM   #1
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Question df and du giving grossly different used space


OK, a curiosity I just happened to notice while running a backup of my desktop...
Code:
phillips@phillip-desktop:/home$ sudo df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              29G  3.3G   25G  12% /
varrun                506M   84K  506M   1% /var/run
varlock               506M     0  506M   0% /var/lock
procbususb             10M  148K  9.9M   2% /proc/bus/usb
udev                   10M  148K  9.9M   2% /dev
devshm                506M     0  506M   0% /dev/shm
lrm                   506M   18M  489M   4% /lib/modules/2.6.17-10-generic/volatile
/dev/sda3             116G   67G   44G  61% /home
phillips@phillip-desktop:/home$ sudo du -hs /home
52G     /home
Note that `df -h` tells me that /home has 67gb used, but `du -hs` tells me that /home is only 52gb... Now I could handle a minor variance between the two due to rounding, but 15gb / 30% difference?

Note I sudo'ed both of these command so it shouldn't be permissions or anything. What am I missing?

This is Linux Mint 2.1 "Bianca" which is based on Ubuntu 6.10.
 
Old 05-21-2007, 06:34 AM   #2
lein
Member
 
Registered: Jul 2006
Location: Australia
Distribution: Mint 14/16 & Raspbian
Posts: 73

Rep: Reputation: 23
Possibly 52GB free?

116-67=49

Less error. But I am clutching at straws.
 
Old 05-21-2007, 07:41 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
http://gcolpart.evolix.net/blog21/df...vs-du-command/ might give the answer.
 
Old 05-21-2007, 08:00 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

The 'dotted' files are not counted with an ordinary du.

Try this in your homedir:

cd ~
du -sch *

and then

du -sch .*

Hope this helps.

EDIT:

The above is BS. Sorry.

Mmmmm....... this (du -sch .*) will start one dir up, it doesn't take the dot files.

Last edited by druuna; 05-21-2007 at 08:09 AM. Reason: Answer is wrong, explained why
 
Old 05-22-2007, 03:39 AM   #5
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by Wim Sturkenboom
Boom boom, that was it
Code:
root@phillip-desktop:~# lsof | grep '(deleted)' | grep home
beagled    4714   phillips   11w      REG        8,3 18865228196    5197427 /home/phillips/.beagle/Log/2007-05-16-19-35-56-Beagle (deleted)
I killed that process, and the file is no longer open but it's still showing a discrepancy - at least I know where it's coming from. fsck might help...

Thanks all for the quick replies!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
giving separate stack space for each task manas_sem Programming 2 03-01-2007 04:34 PM
Live CD not giving itself much disk space veeruk101 Linux - Newbie 1 01-31-2007 09:22 AM
nfs mounted partition giving error "no space left" niranjan_mr Linux - Software 4 01-03-2007 05:01 AM
while installation of linux its giving error like media failure/lack of disk space nagesh555 Linux - Hardware 1 02-12-2006 02:49 AM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration