Skip to main content
NetApp Knowledge Base

Why the result of linux commands "df" and "du" are different after deleting file?

Views:
24,789
Visibility:
Public
Votes:
21
Category:
ontap-9
Specialty:
nas
Last Updated:

Applies to

  • ONTAP 9
  • NFS

Answer

  • du walks through the target and counts the space usage of each object
    • The target can be a directory, subdirectory, file, or the entire filesystem
  • df queries the filesystem for the current space usage

Additional Information

  • When objects are deleted, they are unlinked from the filesystem
    • Unlinked objects take up space until their blocks are reclaimed, but the objects are no longer reported to clients
    • du will report space usage as if the blocks have been reclaimed
    • df will slowly show changes in space usage as the blocks of the deleted object(s) are reclaimed

 

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.