LinuxQuestions.org
Review your favorite Linux distribution.
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 06-06-2012, 02:44 PM   #1
CHIadam
LQ Newbie
 
Registered: May 2012
Distribution: RHEL, CentOS
Posts: 16

Rep: Reputation: Disabled
what is taking up space on / partition


Hello all,

I am trying to figure out what is taking up so much space on my / partition. when I run

#df -h

I get

/dev/sda3 15G 11G 3.5G 76% /

However when I run
#find / -type f -size +250M -exec ls -lh {} \; | awk '{print $5 ": " $NF}'

I get (I have to xxx out all the file names):

351M: /xxx
429M: /xxx.tar
66G: /proc/kcore
1.1G: /xxx.gz
251M: /xxx
528M: xxx.unl
395M: /xxx.txt
2.0G: /xxx.txt
472M: /xxx.log
1.4G: /xxx.audit.log
934M: /xxx.log
770M: /xxx.audit.log_bak
583M: /xxx.debug
1.9G: /xxx

Question 1) So my question is, how is there a 66G directory in my / partition that is only 15G large?

Question 2) Anyone have any input on a better approach for this noob?

Thanks!
 
Old 06-06-2012, 03:11 PM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by CHIadam View Post
I am trying to figure out what is taking up so much space on my / partition. when I run

#df -h

I get

/dev/sda3 15G 11G 3.5G 76% /
looks fairly reasonable. You're probably using a journaling file system (like ext3, for example). There is a certain percentage of the capacity reserved for the journal, and that space is reported as neither "Used" nor "Available". That accounts for the missing half gigabyte, I think.

Quote:
Originally Posted by CHIadam View Post
#find / -type f -size +250M -exec ls -lh {} \; | awk '{print $5 ": " $NF}'

I get (I have to xxx out all the file names):

351M: /xxx
429M: /xxx.tar
66G: /proc/kcore
1.1G: /xxx.gz
251M: /xxx
528M: xxx.unl
395M: /xxx.txt
2.0G: /xxx.txt
472M: /xxx.log
1.4G: /xxx.audit.log
934M: /xxx.log
770M: /xxx.audit.log_bak
583M: /xxx.debug
1.9G: /xxx

Question 1) So my question is, how is there a 66G directory in my / partition that is only 15G large?
There isn't. The /proc directory is a virtual file system - that is, it doesn't exist as a physical directory on your HDD, and it doesn't take up any space. Its contents is generated on-the-fly by the kernel when it's being requested, and it's duplicated many times under different paths. Browsing the directory tree, as find does, you request every possible representation of the data, and obviously, that's an awful lot.

By the way, you seem to have a lot of strange files in your root directory. Usually, this directory should remain almost clean. There may be symlinks to the current kernel and initrd, but otherwise there should only be the standard Unix/Linux directories, no files.

Quote:
Originally Posted by CHIadam View Post
Question 2) Anyone have any input on a better approach for this noob?
To achieve what exactly?

[X] Doc CPU
 
Old 06-06-2012, 03:12 PM   #3
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 4,210

Rep: Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186Reputation: 1186
Welcome to the forums!

1) /proc is not a "real" folder that uses space on your hard drive. http://en.wikipedia.org/wiki/Procfs

2) 11gb used seems reasonable to me; I'm not sure what the problem is exactly. Which distribution are you using? I may be able to recommend some distro-specific housekeeping you can do to keep the size down.

Generally speaking you should not go around deleting/editing/moving files outside your /home folder. These are important system files and deleting them without understanding the consequences can break your system.
 
Old 06-06-2012, 05:55 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
An alternate approach is to use the du cmd http://linux.die.net/man/1/du which has various options to analyse disk usage. One example would be
Code:
cd /

du -sh *

#OR to skip warnings about proc dir
du -sh * 2>/dev/null
 
Old 06-06-2012, 06:11 PM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,823
Blog Entries: 1

Rep: Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218
ncdu might also come in handy.
 
Old 06-07-2012, 11:34 AM   #6
CHIadam
LQ Newbie
 
Registered: May 2012
Distribution: RHEL, CentOS
Posts: 16

Original Poster
Rep: Reputation: Disabled
noob double post

Last edited by CHIadam; 06-07-2012 at 11:35 AM.
 
Old 06-07-2012, 11:35 AM   #7
CHIadam
LQ Newbie
 
Registered: May 2012
Distribution: RHEL, CentOS
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Doc CPU View Post
Hi there,



looks fairly reasonable. You're probably using a journaling file system (like ext3, for example). There is a certain percentage of the capacity reserved for the journal, and that space is reported as neither "Used" nor "Available". That accounts for the missing half gigabyte, I think.



There isn't. The /proc directory is a virtual file system - that is, it doesn't exist as a physical directory on your HDD, and it doesn't take up any space. Its contents is generated on-the-fly by the kernel when it's being requested, and it's duplicated many times under different paths. Browsing the directory tree, as find does, you request every possible representation of the data, and obviously, that's an awful lot.

By the way, you seem to have a lot of strange files in your root directory. Usually, this directory should remain almost clean. There may be symlinks to the current kernel and initrd, but otherwise there should only be the standard Unix/Linux directories, no files.



To achieve what exactly?

[X] Doc CPU
Thanks Doc.

"To achieve what exactly?" I am trying to clean up the contents of this partition as it is hitting our disk usage alert monitor. I was wondering if there was a better way to find out what is taking up space, but I think my find | awk one liner did a great job.

I know there are a lot of strange files, I "xxx" them out because there is information regarding a trading application that I didnt want the world to see (or competitors).

Looks like I can clean up some logs and the get the %disk usage alert to go away.

Everyone else, thank you very much for your input. Greatly appreciated!
 
Old 06-07-2012, 03:25 PM   #8
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by CHIadam View Post
I know there are a lot of strange files, I "xxx" them out because there is information regarding a trading application that I didnt want the world to see (or competitors).
I wasn't referring to the file names - I understood that you camouflaged them.
I was rather referring to the location: They shouldn't be in the root directory.

[X] Doc CPU
 
Old 06-07-2012, 04:13 PM   #9
CHIadam
LQ Newbie
 
Registered: May 2012
Distribution: RHEL, CentOS
Posts: 16

Original Poster
Rep: Reputation: Disabled
This box was from another office and that admin decided not to make a home partition. That explains it
 
  


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
What is taking up all the space on sda6? Leirith Linux - Server 9 04-17-2012 02:54 PM
Stuck in increasing the size of root partition by taking space from XEN LVM aligator007 Linux - Virtualization and Cloud 0 11-20-2010 01:40 AM
/home partition taking space from / partition rpcutts Linux - Software 3 03-04-2009 05:09 AM
ubuntu gutsy taking up 15 gb of space paulwall Ubuntu 12 03-13-2008 11:09 AM
Deleted files taking up space airwolf2 Linux - Newbie 2 12-09-2007 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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