On Wednesday June 3 2009, Ben Kevan wrote:
I have a machine here where df shows a mount point being 100% full. However, when you do a du -h it shows that only 1.1G of the 5G is being used. How can I make sure that df is reporting accuratly?
They report different things. Df looks at file system-wide index information that the file system keeps track of during ongoing operations. Du traverses the directory structure from the starting point(s) you specify as arguments and adds up the space used by each file it encounters. If you really do start du at the root of a file system and it has access to all the directories it encounters (guaranteed only if run as root), then it is accurate, with one possible exception: If a file is "sparse" (regions that have never been explicitly written but only seeked over during writing) it will over-report usage based on the file's size under the assumption that ever logical sector of the file occupies a physical sector on the disk. If there are no sparse files, du sees the whole file system and there's a discrepancy w.r.t. df, then there could be some form of corruption in the file system, as unlikely as that is in practice. The most likely source of discrepancy is that you're not really applying du to the entire file system (a generalization of Rajko's suggestion). Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org