xfs
[Top] [All Lists]

Re: What's wrong with df?

To: Federico Sevilla III <jijo@xxxxxxxxxxxxxxx>
Subject: Re: What's wrong with df?
From: Steve Lord <lord@xxxxxxx>
Date: Mon, 14 May 2001 09:08:24 -0500
Cc: Linux XFS Mailing List <linux-xfs@xxxxxxxxxxx>
In-reply-to: Message from Federico Sevilla III <jijo@xxxxxxxxxxxxxxx> of "Mon, 14 May 2001 18:52:18 +0800." <Pine.LNX.4.21.0105141844370.3448-100000@xxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
I cannot speak for the differences between du and df on reiserfs, but I can
on XFS.

du works by traversing the directory tree doing stat's on all the files
and summing the blocks it finds. df usually works by looking at some
global counters maintained by the filesystem. The difference is that
df is looking at the total space usage in the filesystem including meta
data not directly associated with files. In XFS there are maps of free
space and free inodes which are not accounted for as part of any file.

So typically df will report more space used than du will, in fact I would
be worried if it did not.

Steve 

> Hi everyone,
> 
> While migrating a ReiserFS partition to XFS, I noticed that df reported a
> pretty significant space utilization difference between the two
> filesystems. I transferred my files using two methods, and both had
> identical results.
> 
> First I used tar from /xfs: "tar -cl /reiserfs | tar xv", then I used cp:
> "cp -a /reiserfs /xfs". Here is the output when I ran "df -h" after each
> file transfer operation:
> 
> Filesystem    Size    Used    Avail   Use%    Mounted on
> /dev/hda5     2.0G    692M    1.4G    33%     /reiserfs
> /dev/hda3     952M    746M    206M    78%     /xfs
> 
> If this is accurate (although it doesn't seem accurate as I will later
> elaborate), then XFS uses 52MB more than ReiserFS does for a relatively
> small partition (this is actually my root partition, and I only exclude a
> small boot and the home partition).
> 
> I decided to check using du by running "du -csm" and found that ReiserFS
> uses 734MB and XFS uses 733MB. This looks more accurate. Would anyone know
> what's wrong with df? It's a much handier tool to use than du, but if it's
> not accurate then it doesn't look like a good tool to use, handy or not.
> 
> Thanks in advance for your comments and suggestions.
> 
>  --> Jijo
> 
> ---
> Linux, MS-DOS, and Windows NT ...
> ... also known as the Good, the Bad, and the Ugly



<Prev in Thread] Current Thread [Next in Thread>