Operation and maintenance - The results of df -h and du -sh in Linux space are quite different. . .
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 13:28:58
0
3
785

The cloud server alarms that the remaining space is insufficient. Log in to the server and use df -h to view the situation as follows:

But when I used du-sh * in the root directory to check the size of each folder, I found that the sum of these folders was far from 31G. Why is this? (The 23G of share is a mounting disk, which is reflected in df -h in the above picture)

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
Peter_Zhu

The way they count is different. One possibility of such a big difference is that the files being used are deleted.
You can use the command lsof|grep delete to see which files have been deleted but are still occupied by the program.
These programs need to be restarted to free up the space occupied.

仅有的幸福

The basic reason is what @vvpale said,
The reasons and solutions for the inconsistent disk space usage displayed by df and du are for reference

左手右手慢动作

Two situations

1. df includes the space that has been deleted but not released, and can be viewed through lsof grep deleted.
2. There are contents in some directories, but they are used as other partitions on the mount, so the contents in this directory cannot be seen, but they are still there.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template