# leak of space on /var



## d0wn (Mar 24, 2011)

Hi everybody)
There's a quite simple situation, but I cannot find the answer.

I have got 386 8.0-RELEASE on a VMware and cacti, mysql, apache running on the system.
When the server is coming up it has almost 99% of free space.

After three weeks of server being running the /var partition reduced almost twice.


```
# df -h
/dev/da0s1d    815M    449M    300M    60%    /var
```

I used 
`# du -h /var`
after the server started and three weeks later 
and didn't find any significant change in length of all the listed files.

If I run reboot command the /var is almost empty again.

What did I miss?
How to find out what is the cause of space leak?


----------



## da1 (Mar 24, 2011)

Just a hunch, but since cacti and mysql are on /var, I guess the files belong to them (logs of some kind).


----------



## mamalos (Mar 24, 2011)

Run:
`#  cd /var; du -h -d 1`

It will show you which of /var's subfolder(s) is/are responsible for your situation. It looks like a *newsyslog* situation to me (see /etc/newsyslog.conf) that rotates some logfile of yours into a zipped format, but this is only my shot in the dark. Either way, you should be able to see where data is written on you /var folder.

Good luck


----------



## SirDice (Mar 24, 2011)

Move the MySQL databases to another directory and set in /etc/rc.conf:

```
mysql_dbdir="/some/place/with/more/room/mysql/"
```


----------

