Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 1998 14:31:16 -0500 (CDT)
From:      Guy Helmer <ghelmer@scl.ameslab.gov>
To:        Robert Ricci <rricci@theonlynet.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Full filesystems
Message-ID:  <Pine.SGI.3.96.980630142211.14078C-100000@demios.scl.ameslab.gov>
In-Reply-To: <199806301643.KAA00413@ns2.theonlynet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 30 Jun 1998, Robert Ricci wrote:

> The other day, I accidentally filled up my /var filesystem, causing sendmail to 
> start refusing connections and other fun problems. After removing a ~50MB file, 
> `df` still showed the file system as being past full. Doing a `du -k` in /var 
> showed that I had about 50MB used on this 100MB filesystem, but df still 
> reported 100MB used. Even after killing sendmail and restarting it, it still 
> believed /var was full and refused connections. Finally, I rebooted the machine, 
> and everything began to function correctly. df now reports 50MB used on /var. 
> Short of rebooting, what can I do to make programs recognize that the 
> filesystem is no longer full?
> 
> BTW: This machine is running 2.2.1: has this been fixed in a more recent 
> release?

A file, even if rm'ed, will remain allocated until there exist no
processes which have it open.  In your situation, it is apparent that a
program still had the large (50MB) file open even though the file no
longer had a name.  Because the file did not have a name, "du" did not see
it and thus didn't report its usage as part of the total, but because the
space was still allocated, "df" still reported that the partition was
full. 

BTW, this trait of the UNIX filesystem results in a handy, frequently-used
technique for temporary files.  A temporary file is created, unlink(2)'ed,
and then used normally (written to and read from) by its creator.  When
the program which used the temporary file exits, the temporary file's
allocated space is automatically freed.

Probably more than you ever wanted to know :-),
Guy Helmer

Guy Helmer, Graduate Student, Iowa State University Dept. of Computer Science 
Research Assistant, Ames Laboratory       ---         ghelmer@scl.ameslab.gov
http://www.cs.iastate.edu/~ghelmer



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?Pine.SGI.3.96.980630142211.14078C-100000>