What to delete in /var dir if size of /var directory is 98%?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
@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..)
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 12:21 PM.
Reason: added bit about /var/tmp
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.