LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-12-2011, 04:29 PM   #1
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Rep: Reputation: 1
Question What to delete in /var dir if size of /var directory is 98%?


Hi guys,
This is the output of /var directory which is showing 98% , this is production server, don't know what to delete or move so that size will come to back to 90% or so.

So can you guide me which is directory/file that can be removed to free up the space, I can also share if you need other dir's contents listing.
<root@system45>/var # ls -l
total 272
drwxr-xr-x 3 bin bin 96 Feb 24 2004 X11
drwxr-xr-x 14 adm adm 8192 Sep 16 23:55 adm
drwxr-xr-x 4 bin bin 96 Feb 25 2004 asx
-rw-r----- 1 root sys 31990 Dec 31 2004 config.txt
drwxr-xr-x 4 root sys 8192 Aug 23 2007 dt
drwxr-xr-x 2 root sys 96 Mar 11 2004 empty
drwxrwxrwt 2 bin bin 96 Feb 24 2004 home
lrwxr-xr-x 1 root sys 13 Feb 24 2004 ifor -> /var/opt/ifor
drwx------ 7 root sys 8192 May 19 2004 ios
drwxr-xr-x 2 root root 96 Feb 24 2004 lost+found
drwxrwxr-x 2 bin mail 96 Mar 16 2011 mail
drwxr-xr-x 2 root bin 96 Feb 25 2004 mysql
drwxrwxrwx 2 bin bin 96 Feb 25 2004 news
dr-xr-xr-x 4 bin bin 96 Feb 24 2004 obam
dr-xr-xr-x 23 bin bin 8192 Aug 16 2009 opt
-rw-r--r-- 1 root sys 1340 Jul 21 2004 ovsuf
-rw-r--r-- 1 root sys 991 Jul 21 2004 ovsuf.orig
dr-xr-xr-x 2 bin bin 96 Feb 24 2004 parmgr
drwxrwxrwx 2 bin bin 8192 Aug 18 2010 preserve
drwxrwxrwx 2 bin bin 96 Feb 25 2004 rbootd
dr-xr-xr-x 3 bin bin 8192 Sep 16 22:24 run
dr-xr-xr-x 9 bin bin 8192 Sep 16 22:25 sam
drwxr-xr-x 13 root sys 8192 Jun 22 14:03 spool
drwxr-xr-x 6 root root 96 Jun 29 2004 statmon
drwxr-xr-x 6 root other 96 Jul 14 2004 stm
drwxrwxrwx 10 bin bin 8192 Oct 13 01:51 tmp
drwxr-xr-x 2 root root 8192 Sep 16 22:24 tombstones
dr-xr-xr-x 6 bin bin 96 Feb 25 2004 uucp
dr-xr-xr-x 4 bin bin 96 Feb 25 2004 vx
drwxr-xr-x 3 bin bin 8192 Mar 15 2010 yp
 
Old 10-12-2011, 04:35 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
not from that information, no. could be anything. When I'm trying to track excessive disk usage down I run "du -h --max-depth=1 /var" for example and that will give directory level summaries of disk usage. I can then drill down into a directory, "du -h --max-depth=1 /var/spool" etc. until I find what i'm looking for.
 
Old 10-12-2011, 04:38 PM   #3
jthill
Member
 
Registered: Mar 2010
Distribution: Arch
Posts: 211

Rep: Reputation: 67
It's probably not the best idea to ask random people on the net to recommend what files you delete from a production server. Ask someone who knows why your systems are set up the way they are. Just looking at the filenames in there isn't going to be enough, there's no telling from outside who cares about particular files.
 
Old 10-12-2011, 05:07 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Well said. I wouldn't trust me.
 
Old 10-15-2011, 12:01 PM   #5
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Actully all old guys who new about these systems have moved away, so only we new comers are supposed to reduce/maintain this size without damaging the production server.
 
Old 10-15-2011, 12:08 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
@manalisharmabe: What OS / version? (And for the love of all that is sweet and chocolatey, use freakin' code tags.)

If you had informed us (in your initial post) that this is a recent RH-based system, I'd say you could buy yourself a small amount of time using:
Code:
# yum clean all
Are you using LVM2 on this server? If so, can you grow the LV (or add PVs to the VG, and then grow the LV)?

Is that a MySQL installation we see under /var? Any possibilities of planning to migrate that to a new volume?

If you can't answer these questions, or if they don't lead to fruitful plans, then what acid_kewpie recommended is the right approach. It doesn't look like you followed his advice yet. Time to get moving. (You need to determine which files and directories are actually eating up the space. You should probably do that regardless of the plan..)
 
Old 10-15-2011, 01:20 PM   #7
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Quote:
drwxrwxrwt 2 bin bin 96 Feb 24 2004 home
Why is there a /home directory in /var?

As anomie said, clear the package manager cache.

Also check /var/log, if something is chronically broken, it could be dumping a ton of log entries.
Is logrotate installed and working? Log files compress really well, as they contain predominately repetitive data..

Using the du-h command acid_kewpie said is far more useful (so is "ls -lh" btw) than "ls -l", the "-h" option means "human readable" give you sizes in K, M, G, instead of bytes. Notice how all the directories show up as being the same size? That is how the linux file system works. "du" will give you the size of everything in the directory. "man du" for more information..

Also, check in "/var/tmp"....

Last edited by fukawi1; 10-15-2011 at 01:21 PM. Reason: added bit about /var/tmp
 
  


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] /var/lib/amavis dir becoming big farooklk Linux - Server 2 08-16-2011 02:32 AM
DF -h shows md2 100% under var dir Exrace Linux - Newbie 1 11-19-2010 10:26 AM
Apache2 root server showing directory contents of a symbolic link in the /var/www dir rtoney5 Linux - Server 7 09-03-2010 08:50 PM
owner of dir /var/spool/amavis is changed saavik Linux - Server 4 10-02-2007 08:27 AM
/ Var directory was delete.system cannot login! xi_guadiy Linux - Server 6 08-30-2007 12:27 PM


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