use of /var folder

4 posts / 0 new
Last post
#1 Fri, 04/12/2013 - 02:55
sid

use of /var folder

Hi I have some strange problem my /var dir is on separet partition of 7 GB. When I execute df -h var/ Filesystem Size Used Avail Use% Mounted on /dev/sda7 7.4G 6.6G 379M 95% /var

But when I type: du -ch var/

793M total

what is the problem and how is this possible? I'm using Ubuntu server

Sat, 04/13/2013 - 01:32
sid

Can some one help me because this is very important to me.

Thanks a lot

Tue, 04/23/2013 - 13:16
sid

I have found a solution. Its because if you open a file and after delete it is still in memory and that why it take a lot of space. You can scan for open files with this command: sudo lsof -n | egrep "/var/" | sort -n -k5 and close it. But be cearfule because apache may need to be started.

Thu, 04/25/2013 - 02:27
remibruggeman

it is interesting to put a logfile rotation so that you do not get logfiles of +30MB. This avoids big logfiles. The larger your logfiles, the slower your system.

Topic locked