- 论坛徽章:
- 0
|
顶一顶
我也曾遇到过这样的问题,最重要的是这段话:
- This section gives the technical explanation of why du and df sometimes report
- different totals of disk space usage.
- When a program that is running in the background writes to a file while the
- process is running, the file to which this process is writing is deleted.
- Running df and du shows a discrepancy in the amount of disk space usage. The
- df command shows a higher value.
复制代码
如果文件已经删除了,但是还有残留的进程引用它(具体不知道怎么表达好),则df看到的空间使用量并没有减去那些已经删除的文件。而创建并写入一个文件是,判断空间是否足够是依据df(本人认为),所以df 100%的时候就不能写入文件了。--但是创建文件是可以的,我做过测试。查看这些残留进程(姑且这么称呼,我也不知道那些进程叫什么)的方法是lsof
- # lsof /home | grep /home/oracle/osinfo | sort +8 | grep '^.*070920.*$'
- sadc 17821 root 3w REG 253,1 326492112 926724 /home/oracle/osinfo/070920sar.data (deleted)
- sadc 17861 root 3u REG 253,1 326492112 926724 /home/oracle/osinfo/070920sar.data (deleted)
- sadc 17981 root 3u REG 253,1 326492112 926724 /home/oracle/osinfo/070920sar.data (deleted)
- top 17858 root 1w REG 253,1 169919916 927111 /home/oracle/osinfo/070920top.data (deleted)
- top 17977 root 1w REG 253,1 169919916 927111 /home/oracle/osinfo/070920top.data (deleted)
- 注意后面的deleted
复制代码
然后把这些进程都kill掉就可以释放空间了。
我遇到这些残留进程是因为僵死进程引起的,但是上面看到的那些进程并非僵死进程。
http://bbs.chinaunix.net/viewthr ... highlight=yuhe27913 |
|