Difference between df and du
有的时候,尤其是 服务器上 你会发现 df和du的结果很矛盾
df告诉你 99% used du会告诉你 所有的文件加起来才10G
原来df和du的计算是有区别的
df告诉你 99% used du会告诉你 所有的文件加起来才10G
原来df和du的计算是有区别的
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.
你用 lsof | grep delete
就可以看出有很多 虽然已经被删除 但是仍然打开的文件 把相应的进程杀掉就是了。。
嘿嘿
Comments
Post a Comment