跳转到主内容

为什么Linux命令"df"和"du"的结果不同?

Views:
14
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
nas
Last Updated:

适用场景

  • ONTAP 9
  • NFS

问题解答

  • du 遍历目标并计算每个对象的空间使用量
  • 目标可以是目录、子目录、文件或整个文件系统
  • df 查询文件系统中的当前空间使用量
  • 存储系统启用了 卷效率

示例:

[root@user1]# df -Ph | grep DB
192.xxx.xxx.xxx:/vol1    12T  784G  12T   7% /DB

[root@user1]# du -sh /DB/
2.7T  /DB

DF
/vol/vol1/    12884901888  847244892 12037656996     7%  /vol/vol1/
/vol/vol1/.snapshot      0      0      0     0%  /vol/vol1.snapshot

DF -S
Filesystem         used     total-saved   %total-saved   deduplicated   %deduplicated   compressed   %compressed   vbn zero   %vbn zero
/vol/vol1/     847244892     2560004340       75%    1515678176        44%   1044326164       31%   726488260      21%

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.