LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What to delete in /var dir if size of /var directory is 98%? (https://www.linuxquestions.org/questions/linux-newbie-8/what-to-delete-in-var-dir-if-size-of-var-directory-is-98-a-907825/)

manalisharmabe 10-12-2011 03:29 PM

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

acid_kewpie 10-12-2011 03:35 PM

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.

jthill 10-12-2011 03:38 PM

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.

acid_kewpie 10-12-2011 04:07 PM

Well said. I wouldn't trust me.

manalisharmabe 10-15-2011 11:01 AM

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.

anomie 10-15-2011 11:08 AM

@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..)

fukawi1 10-15-2011 12:20 PM

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"....


All times are GMT -5. The time now is 08:42 PM.