Why do df and du commands show different disk usage?

Why do df and du commands show different disk usage?

There are times when the du and df commands can show different disk usage stats. The usual reason for this is that a running process still has a file that was removed open. The solution to this issue is to reload or restart that service so that it closes that file handle.

Is df or du more accurate?

df vs. du. The (very complicated) answer can be best summarized like this: The df command provides a sweeping ballpark figure for how much space is being utilized on your filesystem as a whole. The du command is a much more accurate snapshot of a given directory or subdirectory.

What is difference between du and df?

du is used to estimate file space usage—space used under a particular directory or files on a file system. df is used to display the amount of available disk space for file systems on which the invoking user has appropriate read access. The result of the command du doesn’t include the size of the deleting file.

What is the difference between df and free?

The two terms that consistently we talk about is Used disk space and free disk space. Free space is what is available to use and Used space is what is already taken up by existing data on the computer. The two important command lines used in Linux system is “df” and “du” commands.

What is the difference between the df and du commands?

What is the use of df?

Use the df command to display information about total space and available space on a file system. The FileSystem parameter specifies the name of the device on which the file system resides, the directory on which the file system is mounted, or the relative path name of a file system.

What is the use of df command?

The df command (short for disk free), is used to display information related to file systems about total space and available space. If no file name is given, it displays the space available on all currently mounted file systems.

What is output of df?

Use the df command to show the amount of free disk space on each mounted disk. The usable disk space that is reported by df reflects only 90 percent of full capacity, as the reporting statistics leave 10 percent above the total available space. This head room normally stays empty for better performance.

Why do ” DF ” and ” du ” commands show different disk usage?

While df is to show the file system usage, du is to report the file space usage. du works from files while df works at filesystem level, reporting what the kernel says it has available. Continue reading the du manpage support this: Summarize disk usage of each FILE, recursively for directories. it says du works with files.

What’s the difference between DF and du file size?

The page you link to is wrong. du shows block usage by default, not file size. You have to do du -b or du –apparent-size to get the effect you describe. Probably df is accounting for all the space allocated for inodes and other administrative overhead, whereas du is just accounting for the space used by the files.

What’s the difference between DF and free space?

We can do a test, du says you have 10GB free space, while df says 300 MB, can you write a file (or several files) with size of, say, 2 GB? If you can, that means that df is just simply wrong (and there is actually no problem of ‘lost space’). If not, then du is wrong (which will be interesting).

When does du report a deleted file as free space?

Additionally, if a file is deleted while an application has it opened, du will report it as free space but df does not until the application exits.