df查看发现磁盘使用空间为100多G,但用du查看实际使用空间不到30G。因此70多G空间是因为删除正在读的文件而导致文件被删除而空间没释放造成的。用lsof查看如下面所示,见标红行。处理办法: 1.重启机器或者重启相关服务(http)。 2.删掉进程,具体为: php 13479 apache 1w REG 253,0 75514309287 1051783 /tmp/audit_priority.log (deleted) 从lsof的输出中,可以发现pid为13479 的进程持有着以文件描述号(fd)为 1打开的文件/tmp/audit_priority.log。在我们找到了这个文件之后可以通过结束进程的方式来释放被占用的空间:echo > /proc/13479 /fd/1 另外请注意:删除正在写的文件一般用 cat /dev/null > file,而不是直接rm(直接rm会造成文件删除空间不释放的问题)。 [root@h3.web.mzone.mdc.139.com /]# /usr/sbin/lsof|grep deleted php 4223 apache 1w REG 253,0 306483577 22578341 /tmp/status.log (deleted) php 4223 apache 2w REG 253,0 306483577 22578341 /tmp/status.log (deleted) php 7136 root 3uW REG 253,0 0 7410877 /var/lib/php/session/sess_vi88skak23129mhai12md342m6 (deleted) memcacheq 11644 apache 0u CHR 136,1 3 /dev/pts/1 (deleted) memcacheq 11753 apache 0u CHR 136,1 3 /dev/pts/1 (deleted) php 13479 apache 1w REG 253,0 75514309287 1051783 /tmp/audit_priority.log (deleted) php 13479 apache 2w REG 253,0 75514309287 1051783 /tmp/audit_priority.log (deleted) php 23809 apache 1w REG 253,0 19613 22578349 /tmp/webdisk.log (deleted) php 23809 apache 2w REG 253,0 19613 22578349 /tmp/webdisk.log (deleted) php 24935 apache 1w REG 253,0 571 22578598 /tmp/audit_auto_memcached.log (deleted) php 24935 apache 2w REG 253,0 571 22578598 /tmp/audit_auto_memcached.log (deleted) memcacheq 26671 apache 0u CHR 136,0 2 /dev/pts/0 (deleted) memcacheq 26677 apache 0u CHR 136,0 2 /dev/pts/0 (deleted)