Sometimes you will come across situation where the server disk space shows full on df but du shows plenty of space left. This is because you can remove a file that is still in use by some application and for this application it remains available because file descriptor in /proc/ filesystem is held open. So if there are such open descriptors to files already removed, space occupied by them is considered as used by df but they can not be taken into account by du because there are no filenames associated with them.

The following command will list those processes:
 lsof | grep '(deleted)'
You can either kill those process or restart the service that seems to be causing this.

In case you need to kill all the process at once use the following command:
for n in $(lsof | grep '(deleted)' | awk '{print $2}') ; do kill -9 $n; done

(Visited 418 times, 1 visits today)
Categories: Website


Leave a Reply

Avatar placeholder

Your email address will not be published.