Question & Answer
Question
Why does the disk usage reported by df not match du?
Cause
- Perhaps the most common cause is files that are still open by an application, but have been unlinked (deleted). This may be intentional, for example an application may use this technique to create hidden scratch files; or it may be accidental, a user may delete a large file without realising that it is currently open by an application.
Such files and their details can be listed using "fuser -dV". For example:# fuser -dV /u02
/u02:
inode=7940 size=10431209472 fd=19 8716442
inode=7931 size=17823825920 fd=19 10354918
inode=7936 size=12891316224 fd=18 10485994
inode=7945 size=5706391552 fd=19 11075828
The size is in bytes. The number in the right hand column is the process id that is holding that file open. When that process terminates, the space will be released and this will be reflected in the df output. Since the file is deleted from the directory, it is not possible to find its name.
- If the filesystem in question has nested filesystems, it is not valid to compare df and du. du will count the usage in the nested filesystems, and it cannot count the usage in directory trees of the parent filesystem that may be hidden under the mount points.
It is possible to view the hidden directory structure under a mount point without unmounting the child filesystem. One way is to use a namefs mount. For example, say there is a filesystem /audit. To check if there are any files hidden in the root (/) filesystem under the /audit directory:
# mkdir -p /temproot
# mount -v namefs -r / /temproot
# ls -lR /temproot/audit
Any files listed reside in the parent / filesystem.
Remember to unmount /temproot when done.
- The filesystem may be corrupted. In this case, unmount and run "fsck -yvv" to make it consistent
- AIX 7.2 has an enhancement to release space in the background when large files are deleted. If very large files are deleted there can be a time lag before df reports the freed space. This should not be noticeable unless many terabytes of files are deleted
- There were bugs in early levels of AIX 7.2 where the background release did not work under certain conditions. In this case, unmount/remount would reflect the freed space.
IJ09280 FREEING UP INODES SOMETIMES DOES NOT FREE UP DISK SPACE. fixed 7.2.2.19/7.2.3.0
IJ12633 J2GT THREAD PERFORMANCE ISSUES fixed 7.2.3.17
IJ18827 j2gt won't delete recently added files right away Fixed 7.2.3.18
Answer
| SUPPORT | ||
|---|---|---|
|
If additional assistance is required after completing all of the instructions provided in this document, please follow the step-by-step instructions below to contact IBM to open a case for software under warranty or with an active and valid support contract. The technical support specialist assigned to your case will confirm that you have completed these steps. 1. Document and/or take screen shots of all symptoms, errors, and/or messages that might have occurred. 2. Capture any logs or data relevant to the situation. 3. Contact IBM to open a case: -For electronic support, please visit the IBM Support Community: 4. Provide a good description of your issue, and reference this Technote, and any issues you had with the instructions. 5. Collect the system snap and upload all of the details and data for your case.
|
Related Information
Was this topic helpful?
Document Information
Modified date:
08 May 2020
UID
ibm10887143