0

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?

chrishiestand
  • 974
  • 12
  • 23
sid606
  • 103
  • 3
  • Take a look at the answers here http://serverfault.com/questions/485483/root-full-linux-no-free-blocks/485495#485495 – user9517 Apr 13 '13 at 08:04

2 Answers2

1

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.

Cry Havok
  • 1,825
  • 13
  • 10
0

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

  • `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 07:03