LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   rm doesn't free the disk space (http://www.linuxquestions.org/questions/linux-general-1/rm-doesnt-free-the-disk-space-290716/)

krizzz 02-15-2005 09:01 PM

rm doesn't free the disk space
 
Hello,

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
:confused:

Tinkster 02-15-2005 11:29 PM

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


Cheers,
Tink

twantrd 02-16-2005 03: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.

-twantrd

Hobbletoe 02-16-2005 08: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 11: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 12:27 PM

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 01:03 PM.