Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problems with /var partition filling up all the time [Linux Red Hat 7.3]

Posted on 2007-03-20
5
Medium Priority
?
417 Views
Last Modified: 2013-12-16
I am having a huge problem here with my /var partition filling up on my Linux Red Hat box. This is stopping all email sent from my web server due to lack of space. I usually solve the problem by deleting log files and other miscelaneous stuff on the /var directory but this time I ran out of files to delete.
So I was investigating and it seems like /var/lib/rpm is taking up a lot of space (26 MB) that I could use. Can I just delete this directory? Why is it so big??? I don't understand.
[root@internal var]# pwd
/var
[root@internal var]# du -sh *
41k     arpwatch
1.9M    cache
1.0k    db
2.0k    gdm
26M     lib
1.0k    local
2.0k    lock
3.2M    log
12k     lost+found
0       mail
1.0k    nis
1.0k    opt
1.0k    preserve
25k     run
29k     spool
1.0k    tmp
1.0k    tux
7.0k    webmin
1.1M    www
20k     yp
[root@internal var]#

As you can see the only thing there taking up a lot of space is lib which insisde contains RPM files which are taking a lot of space. Can I go ahead and delete those files or just empty whatever is in them.


Also notice that when I do : df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda6             372M  142M  211M  41% /
/dev/hda1              45M   18M   25M  42% /boot
/dev/hda5              11G  3.1G  7.3G  30% /home
none                  314M     0  313M   0% /dev/shm
/dev/hda2              24G  1.2G   21G   5% /usr
/dev/hda7             251M  238M     0 100% /var

/var seems to have 251 MB of space but when I do

[root@internal /]# du -sh *
5.8M    bin
14M     boot
270k    dev
5.9M    etc
3.1G    home
1.0k    initrd
92M     lib
12k     lost+found
1.0k    misc
3.0k    mnt
1.0k    opt
du: `proc/16060/fd/3': No such file or directory
2.0k    proc
4.7M    root
8.5M    sbin
115k    tmp
1.1G    usr
32M     var

It says var only is using 32MB?
How can this be?

I am somwhat stumped and I need my web server to start sending emails asap.
0
Comment
Question by:caragol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 14

Accepted Solution

by:
sjm_ee earned 1000 total points
ID: 18759275
You say "/var/lib/rpm is taking up a lot of space (26 MB)" but that's trivial on your disk overall.

More important is /var showing 238MB used in df but only 32MB in du.  This is usually caused by a file that had been deleted but is still open by one or more processes. Try this command:

lsof -a +L1 /var
0
 

Author Comment

by:caragol
ID: 18759294
well I just solved my problem. I rebooted the webserver. I know df and du can give different results depending on which files have been deleted and are still in use ETC. Anyway is there a way to do this without rebooting, I really should not be solving this problem via reboot. I will give the points to anyone who lets me know how to accomplish this without a reboot.

best.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 18759987
Your /var filesystem is way too undersized.  You should make /var as big as you can afford.  For a disk your size 2GB would have been more sensible.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 21169841
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
ACCEPT sjm_ee's comment {http:#18759275} as answer.

Any objections should be posted here in the next 4 days. After that time, the question will be closed.
JustUNIX, Experts Exchange Cleanup Volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21198252
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question