LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2010, 11:37 AM   #1
nuliknol
Member
 
Registered: Jul 2009
Posts: 42

Rep: Reputation: 0
find hidden disk usage


Hi,
I have a productive sever (very old, 1500 days without restart or software update, gentoo distro) and i have a weird disk usage there:
Code:
gentoo / # du -sk *|sort -n
0       sys
2       service
6       mnt
16      lost+found
724     dev
6270    sbin
6714    bin
6980    etc
10266   boot-before-change-kernel
10338   boot
29734   lib
85372   tmp
102740  opt
125552  ram0
922507  proc
965076  root
2914551 media
5421810 home
8393788 var
14351916        usr
gentoo / # du -skc
du: `./media/Gentoo/proc/4976': No such file or directory
du: `./media/Gentoo/proc/4984': No such file or directory
33380291        .
33380291        total
gentoo / # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p1     67463492  61372500   2663794  96% /
udev                   1037576       724   1036852   1% /dev
shm                    1037576         0   1037576   0% /dev/shm
/dev/ram0               130612    125552      5060  97% /ram0
gentoo / #
You see that on 'df' i have 67 GB on the disk and 2.6GB avaiable, but du is confirming only 33GB of usage. What uses the other 34GB ?
I can't install fancy graphical disk usage programs there, is there any way I can find what is consuming the 34GB of disk using command line tools and standard linux programs? (like debugfs or something like that)

Thanks in advance
 
Old 08-31-2010, 12:11 PM   #2
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 22
They measure 2 different things. du only measures the space used by files and folders. df measures space used by the entire filesystem, including journaling, inode tables, etc.
 
Old 08-31-2010, 12:47 PM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,338

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Hi

Could also be programs writing to files that has been deleted. You don't see them with du, but they still take space.

To see them:

lsof |grep '(deleted)'

Restarting those program should free up some space.
 
Old 08-31-2010, 03:34 PM   #4
dazdaz
Member
 
Registered: Aug 2003
Location: Europe
Distribution: RHEL, CentOS, Ubuntu
Posts: 333

Rep: Reputation: 17
Does that work on both Solaris and Linux ?
 
Old 09-01-2010, 08:29 AM   #5
nuliknol
Member
 
Registered: Jul 2009
Posts: 42

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Guttorm View Post
Hi

To see them:

lsof |grep '(deleted)'

Restarting those program should free up some space.
wow , you rock! I found a 30GB qmail log file! how can it be that large? I thought the limit was 2GB.

Code:
qmail-sen 14201 qmails    0w      REG      104,1 30655949063     921647 /var/qmail/queue/nohup.out (deleted)
mysqld_sa 23489   root    1u      CHR      136,5                      7 /dev/pts/5 (deleted)
mysqld_sa 23489   root    2u      CHR      136,5                      7 /dev/pts/5 (deleted)
haven't restarted qmail in 5 years. Now I did it and I have got 'extra' space, thanks a lot!
Code:
gentoo ~ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p1     67463492  31330160  32706134  49% /
udev                   1037576       724   1036852   1% /dev
shm                    1037576         0   1037576   0% /dev/shm
/dev/ram0               130612    125454      5158  97% /ram0
gentoo ~ #
 
Old 09-01-2010, 09:03 AM   #6
hxcan
LQ Newbie
 
Registered: Mar 2010
Location: 北京
Distribution: Qomo
Posts: 4

Rep: Reputation: 0
Amazing

That's wonderful .
 
Old 08-30-2013, 10:24 AM   #7
justflea
LQ Newbie
 
Registered: Aug 2013
Posts: 1

Rep: Reputation: Disabled
Thank you very much man!

This save my life and I learn something in the process.

I found a 6gb (deleted) file with this lsof trick.


Quote:
Originally Posted by Guttorm View Post
Hi

Could also be programs writing to files that has been deleted. You don't see them with du, but they still take space.

To see them:

lsof |grep '(deleted)'

Restarting those program should free up some space.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk Usage Analyzer reports too much disk space? ler0nldb2 Linux - Newbie 1 09-12-2009 11:27 AM
trying to find a hidden process after chkrootkit dave247 Debian 1 11-19-2008 01:57 PM
Other than top command which cmd is used to find the cpu usage and disk space sathish80 Linux - Newbie 2 11-15-2006 01:43 AM
find disk usage per user on a filesystem kebabhead Linux - General 4 08-06-2004 06:07 PM
Find hidden executable files Wynd Linux - General 2 06-09-2003 04:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:17 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration