-   Linux - General (
-   -   rm doesn't free the disk space (

krizzz 02-15-2005 08:01 PM

rm doesn't free the disk space

I have the disk with ReiserFS. Sometimes it gets full becouse of my php error_log (I know how to deal with php settings and my question is not about it).

My partition is 900MB. My linux uses about 380MB of disk space. So the log must become about 520MB to fill it up. After removing the file I still have whole disk space taken, however the file disapears. After rebooting I'm getting disk space free again. What's the matter?

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda1 975676 975676 0 100% /
/dev/hdb1 11719020 220120 11498900 2% /hdb1

Tinkster 02-15-2005 10:29 PM

Do you stop/restart the webserver when you delete the log?


twantrd 02-16-2005 02:02 AM

Hmm, interesting. If you cat /dev/null > php.log, then you should be able to free up some space in /. Yea, try tinksters suggestion of restarting apache and see if that helps - even though I don't know how it would.


Hobbletoe 02-16-2005 07:03 AM

This problem occurs in Solaris as well once you fill up a disk. The only solution that we've found for it is to reboot the machine. And normally when we would fill up a disk, it was with a database export. As such, I don't think that the problem would be with Apache holding on to that memory (once our export would finish, we would remove the files in question, and still not reclaim the free space, and Oracle wouldn't be holding onto it as that process was finished at the time). I'd definately try restarting the Web Server, but I doubt that it will clean up that free space.

Hobbletoe Clubfoot

LasseW 02-16-2005 10:44 AM

You can see if there are processes using the file with

fuser -v error_log

Stop those processes first, then remove the file.

krizzz 02-16-2005 11:27 AM

Great advice everybody! O course, I haven't stopped apache before deleting the file. Restarting it later, after removing log didn't help but ... I deleted some other small file to get some free bytes. The new log of size of 160B appeared. Then I stopped apache and deleted the new log. The result was that after deleting 160 bytes small file I got 500MB of disk space.. So thank you everybody for the good advice!

All times are GMT -5. The time now is 11:28 PM.