LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   problem with ext4 filesystem (http://www.linuxquestions.org/questions/linux-server-73/problem-with-ext4-filesystem-4175452481/)

farazinux 03-03-2013 05:01 AM

problem with ext4 filesystem
 
Hi,

When a partition with ext4 filesystem, was filled, and I clean some unnecessary files manually, " df -h " command doesn't show free space and it needs to reboot! why? how fix?

Thanks :-)

vikas027 03-03-2013 06:12 AM

Quote:

Originally Posted by farazinux (Post 4903581)
Hi,

When a partition with ext4 filesystem, was filled, and I clean some unnecessary files manually, " df -h " command doesn't show free space and it needs to reboot! why? how fix?

Thanks :-)

I never faced this issue. Please let us know the OS and its version.

druuna 03-03-2013 06:18 AM

Quote:

Originally Posted by farazinux (Post 4903581)
When a partition with ext4 filesystem, was filled, and I clean some unnecessary files manually, " df -h " command doesn't show free space

You might have deleted a file (or files) that was still in use by a running program. If that is the case then the file seems gone (not present in ls output) but the space it takes isn't freed up yet.

The space is freed once you stop or restart the program or, as you have noticed, reboot (which is in essence a restart).

farazinux 03-03-2013 06:57 AM

Restart service or program doesn't solve this problem. Some files which was deleted, is log of services!

OS : Ubuntu server 12.04 - 64 bit

druuna 03-03-2013 07:37 AM

Quote:

Originally Posted by farazinux (Post 4903638)
Restart service or program doesn't solve this problem. Some files which was deleted, is log of services!

The main problem is removing a file that is being used (kept open) by a program, which you shouldn't do.

You can do one of two things when you want to remove open file(s):
- stop the program, remove file and then start the program again,
- don't remove the file, but make it empty (> name.of.file instead of rm name.of.file).

I also noticed that restarting a service after removing an open file doesn't always free up the space. A reboot is the only thing you can do to solve that.

farazinux 03-03-2013 08:57 AM

I think "stop service, make it empty and start service" is a good solution.
I use making empty for deleting log files always :)
Thanks.
I check it and notify the result.


All times are GMT -5. The time now is 01:28 AM.