Re: [Hampshire] Baffled by df/du

Top Page

Reply to this message
Author: Jack Knight
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Baffled by df/du
Jim Kissel wrote:
>
> Just done a clean minimum install of Debian Etch under VMWare 
> Workstation 5.5 and I find df reporting:
> Filesystem           1K-blocks     Used Available  Use% Mounted on
> /dev/hda1              1359816   287656  1992884    23% /
> udev                     10248       56    10184     1% /dev
> devshm                  128588        0   128588     0% /dev/shm
> /dev/hda6              2601116    69516  2399469     3% /home

>
> du -s /home reports
> 40 /home
>
>
> du's 40 used blocks != 69516 Used in df
> I know there is a simple explanation, but what is it?

You need to run du -s /home/* to ensure everything gets counted
recursively under that directory, otherwise only top level files will be
accounted for.

NB: Any files unlinked but held open by running processes will be
counted by *df* but not by *du*.