Solved [Solved] df reports negative value on a local filesystem

Hi,

I have a FreeBD 7.2 i386 on AsRock Conroe 1333 with 2 IDE and 1 SATA disks. I made 2 partitions on this SATA disk, one for a network file share, and one for backup. Both have the UFS2 filesystem. For several months everything was ok but recently after having nearly filled the backup partition, df reports negative value for "Available":

Code:
Filesystem            Size    Used   Avail Capacity  Mounted on
/dev/mirror/gm4s1a    496M    154M    302M    34%    /
devfs                 1.0K    1.0K      0B   100%    /dev
/dev/mirror/gm4s1e    496M     22K    456M     0%    /tmp
/dev/mirror/gm4s1f     67G     24G     38G    38%    /usr
/dev/mirror/gm4s1d    1.9G    174M    1.6G    10%    /var
/dev/ad10e            144G     67G     66G    51%    /usr/samba-shares/personal
/dev/ad10f            144G    136G   -3.6G   103%    /media/bkp

Of course, this contradicts with "Size"-"Used", and du also tells that 136G are used (that should mean 8G are available).

Why is this? Should I fix something or just ignore?

Thanks in advance.
 
8% are reserved for root by default, you see "negative space" because you are using reserved space
This had been discussed many times on this forum (search for similar threads)
 
See tunefs(8), especially read the section under "-m minfree" very carefully. Also, from fs(5):
Code:
The fs_minfree element gives the minimum acceptable percentage of file
     system blocks that may be free.  If the freelist drops below this level
     only the super-user may continue to allocate blocks.  The fs_minfree ele-
     ment may be set to 0 if no reserve of free blocks is deemed necessary,
     however severe performance degradations will be observed if the file sys-
     tem is run at greater than 90% full; thus the default value of fs_minfree
     is 10%.
 
Re: df reports negative value on a local filesystem

I'm getting almost the same problem and can't find the files filling up /var.

du only shows that I'm using 1.7G while df shows I'm using 22GB.

Code:
# df -h
Filesystem       Size    Used   Avail Capacity  Mounted on
/dev/twed0s1a    869G    337G    463G    42%    /
devfs            1.0K    1.0K      0B   100%    /dev
/dev/twed0s1d    1.9G     38M    1.7G     2%    /tmp
/dev/twed0s1e     24G     22G    -15M   100%    /var
procfs           4.0K    4.0K      0B   100%    /proc

# ls | xargs du -hs
2.0K	.cshrc
2.0K	.profile
2.0K	.snap
8.0K	COPYRIGHT
986K	bin
113M	boot
2.0K	cdrom
  0B	compat
9.7M	curlftpfs.core
1.5K	dev
2.0K	dist
4.0K	entropy
 31M	etc
  0B	home
5.4M	lib
170K	libexec
 96K	lost+found
2.0K	media
2.0K	mnt
  0B	proc
144K	quota.group
144K	quota.user
3.6M	rescue
127M	root
3.8M	sbin
  0B	sys
 38M	tmp
310G	usr
1.7G	var

Why aren't df and du agreeing and how can I find the files in /var that are using up all of that partitions space and causing the services (like exim) to stop working?
 
Re: df reports negative value on a local filesystem

Restart all services that are writing their own log files under /var/log, that should make the open files be closed and re-opened again and hopefully show up in directory listings or disappear and stop taking up the invisible used space.
 
Re: df reports negative value on a local filesystem

kpa said:
Restart all services that are writing their own log files under /var/log, that should make the open files be closed and re-opened again and hopefully show up in directory listings or disappear and stop taking up the invisible used space.

That did it. Thank you.
 
Back
Top