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?

sid606
  • 103

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,905
  • 13
  • 10
0

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