Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I have a Ubuntu server running Virtualmin and it's a dedicated web server. But the problem is with the /var directory which is on a separate partition of 7 GB and is now full. But when I run the comand:

df -h /var
Filesystem Size Used Avail Use% Mounted on
/dev/sda7  7.4G 6.6G 379M  95%  /var

and when i run the command:

du -ch var/
 793M total

How I can clean this directory so it won't take so much space?

share|improve this question
Take a look at the answers here… – Iain Apr 13 '13 at 8:04
up vote 1 down vote accepted

You've got a file in /var that's been deleted but is still open. As such it can't appear in the usage stats from du, but it still takes space on the disk until it's closed.

You can use the lsof command to find open files in /var - sudo lsof -n | egrep "/var/" | sort -n -k5 to get the largest open files in /var at the bottom of the list, and what program has it open.

share|improve this answer
Thanks a lot you save my head :) – sid606 Apr 13 '13 at 19:25

You can cd to /var and run du -sh * which will give you the usage of directory in /var partition.

share|improve this answer
du -sh * 1.5M backups 43M cache 4.0K crash 454M lib 4.0K local 0 lock 24M log 16K lost+found 4.0K mail 4.0K opt 92K run 24M spool 4.0K tmp 44K usermin 67M webmin 196K www – sid606 Apr 13 '13 at 7:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.