Today production environment of a server, Zabbix alarm space problem, using the DF command to view, disk space consumption of nearly 100%, the machine is not used on the data and logs out, but the space quickly reached 100%.
Using Du view, want to find out where the disk space is spent, the results found that his output and DF command output difference is very large, away from the 100% space occupied is still far away.
Where's The lost space, is the disk damaged?
Finally, Baidu for a long time, found two possible reasons:
1. After the disk file is deleted, but the original corresponding to the process of writing the file is still, grasping the file, in the inside to write the data, the space continues to be consumed by him, while the deleted space is not released, du command can not see the space occupied by the file.
2. Use the mount command to mount to a directory that has data, and the files in the previous directory are not visible and are not counted by DU.
I have not done any mount on this server, the problem is definitely on 1.
Young I always more impulsive, directly restart the server, the space restored to normal.
Production environment or should honestly follow the following steps to solve
Using Lsof | grep deleted to find deleted files
Kill the process of writing this log file outside, observe the disk space
Re-run the process
This article is from the Linux OPS blog, so be sure to keep this source http://leihuajun.blog.51cto.com/12248802/1960938
CentOS retrieves lost disk space on Linux