Skip site navigation (1)Skip section navigation (2)
Date:      29 Dec 2001 22:28:59 -0500
From:      Joe Clarke <marcus@marcuscom.com>
To:        sothat <sothat@bsd.ee.ntu.edu.tw>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: du and df not consistency ?
Message-ID:  <1009682944.79990.0.camel@shumai.marcuscom.com>
In-Reply-To: <20011230030524.GA32059@bsd.ee.ntu.edu.tw>
References:  <20011230030524.GA32059@bsd.ee.ntu.edu.tw>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2001-12-29 at 22:05, sothat wrote:
> 
>     Hi ,
>     
>         I've met a weird problem the "/" is going out of space.
> 
>     Trying to find out what use the file system , I use
> 
>     du to figure it out what files use the space.

Well, my thoughts would be in either /tmp or /var will give you the most
trouble.  It's not a good idea to leave these on the root filesystem.  /
should be read-only for all intents and purposes.  The more writing you
do to /, the more chance you have to corrupt it.

> 
>     below is df output:
> 
>     Filesystem        1K-blocks     Used    Avail Capacity  Mounted on
>     /dev/da0s1a          297663   255876    17974    93%    /
>     /dev/da1s1e          297663   173693   100157    63%    /usr/local
>     /dev/ad0s1f          992239   668380   244480    73%    /usr/src
>     /dev/ad0s1e         2980238  2209800   532019    81%    /backup
>     /dev/ad0s1g         4037030  2587663  1126405    70%    /backup2
>     /dev/vinum/vinum0   7000492  6230498   209955    97%    /mnt
>     /dev/da2e          68798704  7827914 55466894    12%    /ftp
>     procfs                    4        4        0   100%    /proc
> 
>     the "/" Used 255876 kilo byte
> 
>     But when I use du -d 1 -x in /
> 
>     77      ./dev
>     93796   ./usr
>     1812    ./stand
>     861     ./etc
>     1       ./proc
>     3965    ./bin
>     714     ./boot
>     1       ./mnt
>     5193    ./modules
>     4887    ./root
>     11776   ./sbin
>     17965   ./tmp
>     2468    ./var
>     4       ./modules.old
>     2       ./ftp
>     1       ./mnt2
>     1       ./backup
>     1       ./backup2
>     49      ./lost+found
>     153189  .
> 
>     I just got 153189 kilo. 
> 
>     why the df output and du got the different result ?
>     ( I've sync many times :)

What does echo $BLOCKSIZE report?  What version of FreeBSD is this? 
With 4.5-PRE, and BLOCKSIZE set to K, I get fairly consistent df/du
reporting.  Also, du may report different values if you run it as a
non-root user.  Try doing du -r -d 1 -x and see if you get any errors
about unreadable directories.

Joe

> -- 
> -sothat
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1009682944.79990.0.camel>