Soft-updates & du & df

Glenn Dawson glenn at antimatter.net
Wed Jul 13 23:45:55 GMT 2005


At 02:01 PM 7/13/2005, Hilco Wijbenga wrote:
>Hi,
>
>I've taken over the administration of a FreeBSD box and now I've run
>into a problem that I could not solve by means of Google or the FreeBSD
>mailinglist archives. I am quite familiar with (Gentoo) GNU/Linux but a
>complete newbie when it comes to FreeBSD.
>
>While I was doing some work I got an error about a device being full. As
>it turned out /var was completely full. Not a big problem because there
>were a few very big log files that I could throw away. Problem solved?
>Apparently not because
>
>root at svn[var]# df -h /var
>Filesystem     Size    Used   Avail Capacity  Mounted on
>/dev/ad2s1d    248M    246M    -18M   108%    /var
>
>even though
>
>root at svn[var]# du -hs /var
>  43M    /var

The discrepancy between du and df usually happens when a log file is 
deleted out from under syslogd.  (or something similar)  When that is done, 
syslogd still has the file opened and will still be writing to that file at 
the same offset it was before the file was deleted.  To fix it, just stop 
and restart syslogd and you should see all of the free space you are 
expecting.  (It could be something else, but when that happens in /var it's 
usually syslogd)

-Glenn


>Shouldn't du and df roughly agree on the amount that's used/available?
>
>/var is mounted using soft-updates
>
>root at svn[var]# mount
>/dev/ad2s1a on / (ufs, local)
>devfs on /dev (devfs, local, multilabel)
>/dev/ad2s1e on /tmp (ufs, local, soft-updates)
>/dev/ad2s1f on /usr (ufs, local, soft-updates)
>/dev/ad2s1d on /var (ufs, local, soft-updates)
>/dev/gvinum/raid on /raid (ufs, local, soft-updates)
>
>According to what I found using Google regarding soft-updates this means
>that my changes are not written to disk immediately? Does that have
>anything to do with this?
>
>It looks like I didn't really solve the problem because if I try to copy
>a fairly big file (say 2MB) to the /var/log directory I get another 'No
>space left on device' even though there should now be about 200MB
>available. I can create small files though.
>
>How do I get du and df to agree again? Or do I have a different problem?
>Please let me know if I left out any important information.
>
>Bye,
>Hilco
>
>_______________________________________________
>freebsd-questions at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list