More strange, today with the RM command to delete a large file on the server, DF view hard disk space is not released, after looking for information, summary:
The RM Delete file is unlinked from the directory structure of the file, and if the file is being read and written by the program, such as the httpd service, then the HTTPD service can still read and write the file, causing no space to be released.
We need to find the file first:
ls -lhtr
To find the process that is using the file:
grep trace-file
Find process-related information based on process number
PS grep 2567
Then empty the file you are reading and writing:
When the file is being read and written, deleting the file directly causes the hard disk space to be freed and the user cannot re-access the file, which can only be resumed by a service restart. Large files can be emptied in the case of file inode retention.
[[email protected] ~]# ls -L trace- File -rw-r--r--1 root root 111840 Jan 13 09 : 27 trace-file [[email protected] ~]# echo > Trace-file [[email protected] ~]# ls -L trace-file -rw-r--r--1 root root 1 Apr 9 13 : 29 trace-file
FIX: Deleted file space is not released