Df not updating after delete
Is there any way that I can update the disk information manually without rebooting the host ?When a file is removed/deleted/unlinked, if it is still held open by any process then only the directory entry for the file is erased, not the file's data.
I have an auto increment field connected to an acces datatable. When i delete record 15 and update de tableadapter.
After adding a new row, the auto increment field is numberd 15 instead of number 26 !
As a result, the df command assumes the files are still there, and doesn't clear the space.
Here are some ways you can track which processes still refer to the deleted files.
Before you delete files, either stat them (Entry named Links) or do ls -l on them (should be the second column).
If it does turn out that the files are referenced elsewhere, I guess you'll have to ls -i the file(s) to find the inode-number, and then do a find with -inum The other answers are correct: If you delete a file, and space does not get freed, it's usually either because the file is still kept open, or there are other hardlinks to it.
), or if that doesn't work to restart the server in general.
Alternativaly, if you're using a journaling filesystem (like EXT3), keep in mind that df will also count the space used for this journal log in the output.
Nevertheless, you can reclaim the space without killing the processes.
All you need to do is to remove the file descriptors.
as root run "lsof -n | grep file," you'd be surprised at how long files can stick around due to processes keeping them open for whatever reason.