Linux takes up 100% disk space. After deleting large files, the space is still too large.

Time:2020-8-7

Recently, the disk space of the server system is not enough. Log in to the server to view it. The disk utilization rate reaches 100%, as shown below:

Linux takes up 100% disk space. After deleting large files, the space is still too large.

The first thing I think about is that the log file is too large. After viewing, it is found that the size of the swote log file is too large. After deleting the log file, check:

Linux takes up 100% disk space. After deleting large files, the space is still too large.

The discovery space was not released.

Generally speaking, there will be no space not released after deleting a file, but there are exceptions, such as the file is locked by the process, or a process has been writing data to the file. To understand this problem, you need to understand the storage mechanism and storage structure of files under Linux.

Then through Linux, lsof command troubleshooting

lsof|grep deleted

Linux takes up 100% disk space. After deleting large files, the space is still too large.

It is found that the PHP process takes up a lot of space.

Kill the corresponding process with kill-9 7881, and the disk space will return to normal.