Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

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.

share|improve this question
What do your partitions look like? I wonder if you might be looking in the wrong place for your free space. – Ladadadada Nov 7 '12 at 9:17

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.

share|improve this answer

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
share|improve this answer
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 Nov 7 '12 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.

share|improve this answer

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.