Operating System - Linux
1748201 Members
2915 Online
108759 Solutions
New Discussion юеВ

running low on /var disk space, how to add more?

 
Oskar Teran
Frequent Advisor

running low on /var disk space, how to add more?

hello,
I'm running sles9 SP3.
it's a mail server that's been running very well for a few years now. it's running cyrus as the imap server. The / directory is now over 90% full. When I did a du -sh on it I can see the /var/spool/imap directory is the one with most of the disk space usage.
What is a simple way to add more disk space to the /var directory? I have 2 file systems on the machine, / and /opt2. /opt2 is where I keep the vmware virtual machine as well as the disk backups that get synced to online backup.
I'm thinking I can get more disk space by doing backups on network so I can use that free disk space for /var.
My question is how? I know there are a few ways but I want to be sure I don't damage this system - it is a production mail server.
Thank you,
Oskar
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: running low on /var disk space, how to add more?

Shalom Oskar,

Please post output of following command:

df -kh

If the system is set up with lvm, extending the system is easy. You would increase the diskspace allocated via vmware and then lvextend.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: running low on /var disk space, how to add more?

It sounds like you do NOT have a separate /var filesystem. If that is true, then you can't add disk space to /var specifically unless you create a separate /var file system now. Instead you would need to add disk space to /, or figure out a way to clean up space in the / volume in general.

The first place I would check is /var/log. You may be able to recover some space by removing old log files or trimming large log files.

Oskar Teran
Frequent Advisor

Re: running low on /var disk space, how to add more?

Hi,
I don't have LVM setup.
That would make things easy wouldn't it!

I've already cleaned up the /var/log directory as much as possible.
My problem is that cyrus (/var/spool/imap) has almost 20gb of data.

What else?

Oskar
Nuwan Alwis
Valued Contributor

Re: running low on /var disk space, how to add more?

Hi Oskar,
Wel yes, LVM would be a better solution for this type of problems. but in your case, its not the real problem.
If you say your /var/spool/imap grows to this much and it happens suddenly it can be a caused by a misConfiguration,network or spam problem.
i suggest you to backup all the content of the imap folder and clear all logs and see how fast your file system grows.

that is the best you could do for now.
T. M. Louah
Esteemed Contributor

Re: running low on /var disk space, how to add more?

1. Clean out messages in "/var/spool/imap", you probably have messages dating back to years..
2. Setup a cron job that runs a cleanup script
3. even better use file system monitor, such as OMU, to alert you whne /var get to specific threshold then automatically runs cleanup script
4. creating a soft link to "/var/spool/imap" where you have plenty of space is another approach but it does not get to root cause of the problem.
T+
Little learning is dangerous!
Oskar Teran
Frequent Advisor

Re: running low on /var disk space, how to add more?

All emails in /var/spool/imap are for production use, I can't get rid of them.

I like the idea of a soft link to /var/spool/imap!

I'll try moving the /var/spool/imap contents to /opt2 which has lots of space and put a softlink in the / directory for /var/spool/imap pointing to the real location in /opt2.

Hope this works, I'll do a backup first!

Oskar