LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Freeing disk space (https://www.linuxquestions.org/questions/linux-general-1/freeing-disk-space-758425/)

mohit052 09-29-2009 05:52 AM

Freeing disk space
 
Hi, Had this problem in a few different instances where a process was creating a set of files in directory and using those files.

Some one just happened to go to the dir and deleted those files without stopping the process. The result being that as the process is still telling the machine that the disk usage is still what it initially was (df -h shows the old disk usage) , where as a du -h or a ls -lh on that same dir show that the files are not there.

Once this happened with mysql where the user delete the database dir in /var/database_name in the mysql home dir. The result being that the dusk usage was still showing as the old one even if the files were missing. This was resolved by restarting the mysql server.

Similar thing happened with some other processes where on restarting the problem was resolved..

My question being is there a method to solve this problem by whithout restarting the concerned process.. Some magical command like free disk or recheck dis usage :-) .. may be too much to ask but can some one help me out here.

lutusp 09-29-2009 06:49 AM

Quote:

Originally Posted by mohit052 (Post 3700419)
Hi, Had this problem in a few different instances where a process was creating a set of files in directory and using those files.

Some one just happened to go to the dir and deleted those files without stopping the process. The result being that as the process is still telling the machine that the disk usage is still what it initially was (df -h shows the old disk usage) , where as a du -h or a ls -lh on that same dir show that the files are not there.

Once this happened with mysql where the user delete the database dir in /var/database_name in the mysql home dir. The result being that the dusk usage was still showing as the old one even if the files were missing. This was resolved by restarting the mysql server.

Similar thing happened with some other processes where on restarting the problem was resolved..

My question being is there a method to solve this problem by whithout restarting the concerned process.. Some magical command like free disk or recheck dis usage :-) .. may be too much to ask but can some one help me out here.

The answer is it depends on the process and its code. If the process code makes the assumption that no one would erase open, active files in use by a live process, then there's nothing you can do but rewrite the code or restart the process. There's no third option -- you can't force the process to update its assumptions if it won't do this on its own.


All times are GMT -5. The time now is 03:19 AM.