du and df are different.
du calculates file by file, that means, it will scan every file in the specific directory. so it is slow, most of the time.
df calculates via a smarter way, by the blocks in the block_image_zone in a filesystem, so beside the space recorgnized by du, df will also count such situations in:
1. super blocks, various zones to record the fs informations.
2. blocks which are not full, if 3K of the 4K block is taken by a file, du counts 3K in, but 4K for df.
3. a unlinked file, but still hold by some processes, like yours, you know, it only release the blocks until related processes get quit.
So, du always show you a smaller disk usage than df. but i trust df, which is even faster.作者: flyingkisser 时间: 2007-07-26 09:35
yeah,that's it,thanks.作者: zhangweizj 时间: 2007-07-26 19:58
怎么收藏按钮没了,看来只好回帖做记号了,讲的很明白。