I deleted a 7GB apache2 other_vhosts_access.log.1 to free up some space on our server. Basically I deleted all but the most recent access logs. The largest was uncompressed - I assume it hadn't been through logrotate (which is running).

Running a df -h shows no extra space and I have tried every combination of apache/apachectl restart/reload/graceful etc.. as mentioned in other questions - with no result. lsof doesn't show the file open either.

  • 1
    What do your partitions look like? I wonder if you might be looking in the wrong place for your free space.
    – Ladadadada
    Commented Nov 7, 2012 at 9:17

4 Answers 4


more than likely you have deleted the logs but apache has locked them up.

You should use lsof and look for (deleted). IBM guide here. The way to fix is to restart the apache process to release the file.


Try to copy /dev/null to your logfile. This should truncate your file without closing the file handle apache is holding...

cp /dev/null other_vhosts_access.log.1
  • The principle is sound but if he's already deleted them, he can't do that. Writing to the open filehandle in /proc may work but I've never tried that.
    – Ladadadada
    Commented Nov 7, 2012 at 9:12

I had the same problem and I solved as follows.


I deleted manually access_log and error_log in directory /var/www/vhosts/mywebsite/logs/mywebsite1/ to free up space, but even if the files are disappeared, space is not freed.


I used lsof sorted by size to search big file (command found here):

lsof -s | awk '$5 == "REG"' | sort -n -r -k 7,7 | head -n 100

I found the two big files access_log and error_log in another path (note the difference with previous path):


I reset these two files with command:



The files have been emptied and the space is freed.

Hope it can be helpful.


In my case, I needed to restart rsyslog, which is the one that handles logs on my ubuntu system and it did released all the disk space.

This can be restarted running sudo service rsyslog restart or if you are on 16.04+ with sudo systemctl restart rsyslog.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .