LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2011, 07:52 PM   #1
dangfitz
LQ Newbie
 
Registered: Sep 2011
Posts: 6

Rep: Reputation: Disabled
My / file system says it has 25Gb. How come I can only find about 1Gb?


df -k says 25Gb, but when I go into the individual directories, and do a df -k . to verify that this directory is in /, and add up the results, I come up with a little over 1Gb. Suggestions? df -k shows it at 100% full, and I need to delete whatever is taking up all that space, but all I can find is 1 Gb.
 
Old 09-25-2011, 08:10 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,645

Rep: Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091Reputation: 2091
First, reboot. Same issue ?. If so run the following as root - it'll show you where to start. Might take a while to run too ...
Code:
du -Sx --max-depth=1 / 2>/dev/null | sort -nr | head

Last edited by syg00; 09-25-2011 at 08:11 PM.
 
Old 09-25-2011, 08:12 PM   #3
dangfitz
LQ Newbie
 
Registered: Sep 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks! Rebooting now.
 
Old 09-25-2011, 08:25 PM   #4
dangfitz
LQ Newbie
 
Registered: Sep 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
[root@redhat:~]#du -Sx --max-depth=1 / 2>/dev/null | sort -nr | head
39308 /sbin
29128 /root
22140 /lib64
13640 /lib
7884 /bin
3048 /etc
40 /shimms
36 /tmp
20 /1MAGE
16 /lost+found
[root@redhat:~]#df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
26G 25G 0 100% /
 
Old 09-25-2011, 09:32 PM   #5
dangfitz
LQ Newbie
 
Registered: Sep 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
So, am I missing something? It looks like I'm actually using 1Gb by looking at du, but 25Gb with df.
 
Old 09-25-2011, 11:50 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,440

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
Why are you using the "-S" option? By using that option you are ignoring the space used in subdirectories deeper than your "--max-depth=1" display limit. For example, in /lib you are missing the rather substantial space used under /lib/modules.

Last edited by rknichols; 09-26-2011 at 09:11 AM. Reason: Get rid of extraneous trailing code tag
 
Old 09-26-2011, 12:06 AM   #7
dangfitz
LQ Newbie
 
Registered: Sep 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Better, but still a discrepancy. Should I make the max-depth parameter something silly, like 100?

[root@redhat:/]#du -x / 2>/dev/null | sort -nr | head
3267776 /
2107812 /usr
1116528 /usr/share
378084 /usr/lib64
340236 /usr/lib
324352 /lib
299580 /lib/modules
285180 /usr/share/locale
200256 /home
194252 /var
[root@redhat:/]#
 
Old 09-26-2011, 09:09 AM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,440

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
The max-depth parameter only affects how many levels of subdirectories are printed. It won't affect the numbers for the higher levels. And besides, in your most recent invocation you didn't use that option, and that's equivalent to a max-depth of infinity.

I don't see any mention of you having run fsck on the file system. File system corruption is probably not the cause, but that possibility needs to be eliminated first. Create a /forcefsck file by running
Code:
touch /forcefsck
and then reboot.

Assuming that the fsck doesn't find the problem, the next thing I'd suspect is data hidden under an active mount point, such as /dev, /sys, or /proc. You can find (and correct) that by bind-mounting the root file system to a temporary mount point and then looking under that mount point.
Code:
mkdir /mnt/tmproot
mount --bind / /mnt/tmproot
du --max-depth=1 /mnt/tmproot
Let's take a look at that result. Any directories that are active mount points at the base of the root file system should show up as empty directories (size 4K) in that list.
 
  


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
[SOLVED] system() cannot find file the file specified [WINDOWS] smeezekitty Programming 8 08-06-2010 11:20 PM
how to find which file system i am using babu198649 Linux - Newbie 7 02-07-2008 02:41 AM
how to find out file system type wabaha Linux - Newbie 3 10-25-2007 11:50 AM
How to find Mountpoint of a file system naveen Linux - General 4 05-23-2007 08:21 AM
Where can I find the file over mounten file system Wallace740 Linux - Newbie 2 03-30-2005 02:46 AM


All times are GMT -5. The time now is 12:11 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