Disk df and du inconsistent

Phenomenon:
When df -h found that 90 percent of disk usage, disk du -sh but uses only about 50% of the space.
This is because the direct deleted a file is opened a process, handles the actual cause has not been released.

Investigation method:
sudo lsof | grep -i the Delete> lsof.delete
less lsof.delete where the second as PID, third from the bottom as the size of the file is not listed as a final release handle
solution:
restart the corresponding process (upstairs the PID)
if not at liberty to restart the process, you can choose to empty the file input redirection
permanent solution:
the periodic closing process and remove or delete files
in general such as log files, logs can be cut through the log rotation, with or without logging

Conjecture:
there may be a piece of disk, the data has been written before is not linked to the partition, and then linked to the partition

This will cause the data has been written to be present but not see, df du see the data and not the same

Released six original articles · won praise 0 · Views 31

Guess you like

Origin blog.csdn.net/Abson_Lu/article/details/104520174