Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 1996 18:11:13 +0200 (MET DST)
From:      Greg Lehey <grog@lemis.de>
To:        deischen@iworks.InterWorks.org (Daniel M. Eischen)
Cc:        questions@FreeBSD.org (FreeBSD Questions)
Subject:   Re: Missing disk space
Message-ID:  <199610201611.SAA13263@freebie.lemis.de>
In-Reply-To: <9610170927.AA18514@iworks.InterWorks.org> from "Daniel M. Eischen" at "Oct 17, 96 04:27:53 am"

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Daniel M. Eischen writes:
>
> I recently re-installed FreeBSD from a 2.1.5-RELEASE CD, after
> which I immediately upgraded to -current.  I allocated 50MB
> for the root partition, which has always been more than enough
> with /usr, /home, and /var mounted (or linked to mounted)
> partitions.
>
> A du -kx shows:
>
> bash# du -kx /
> 1       /dev/fd
> 41      /dev
> 2       /usr
> 1       /stand
> ...
> 15439   /
>
> for a total of ~15MB.  Looking at df -k tells a different story:
>
> bash# df -k
> Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> /dev/sd0a       49231    45229       64   100%    /
> /dev/sd1s1e    504046   359048   104676    77%    /opt/a
> /dev/sd1s1f    504046   287618   176106    62%    /opt/b
> /dev/sd1s1g    599060    52364   498772    10%    /opt/c
> /dev/sd1s1a    504046   441594    22130    95%    /usr
> procfs              4        4        0   100%    /proc
>
> Notice there is about 45MB of used disk space for /.  It seems that
> "df -k" is showing what the system thinks is there, because I can
> easily fill up the root filesystem.  But, I know that I haven't used
> that much disk space - manual surfing through / shows the same as
> du.
>
> bash# df -k
> Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> /dev/sd0a       49231    45229       64   100%    /
> ...
>
> bash# dd of=/junk if=/dev/zero bs=1024 count=4000
>
> /: write failed, file system is full
> dd: /junk: No space left on device
> 3969+0 records in
> 3968+0 records out
> 4063232 bytes transferred in 1 secs (4063232 bytes/sec)
>
> bash# df -k
> Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> /dev/sd0a       49231    49205    -3912   109%    /
> ...
>
> Where or where did my disk space go?

Good question.  I can think of several possibilities:

1.  You used it up, and du is lying.
2.  You have a broken file system, and for some reason you haven't
    performed an fsck on the file system since it happened.
3.  (Most likely).  You have data on the root file system in /usr or
    /opt/*.  When you mount the corresponding file system, this data
    is no longer accessible, but it's still there, and it can been
    seen on NFS mounts.

I'd suggest going into single user mode (only / mounted) and doing an
fsck.  Then check with du again.  I suspect that you'll find different
results.

To go into single user mode, you should be able to say 'shutdown now',
but that will almost invariably leave /usr mounted and not
dismountable.  It's easier to reboot and specify the -s option to the
Boot: prompt.

Greg




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?199610201611.SAA13263>