From owner-freebsd-questions Tue Jun 30 12:31:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA18094 for freebsd-questions-outgoing; Tue, 30 Jun 1998 12:31:34 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mailhub.scl.ameslab.gov (mailhub.scl.ameslab.gov [147.155.137.127]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA18073 for ; Tue, 30 Jun 1998 12:31:24 -0700 (PDT) (envelope-from ghelmer@scl.ameslab.gov) Received: from demios.ether.scl.ameslab.gov ([147.155.137.54] helo=demios.scl.ameslab.gov) by mailhub.scl.ameslab.gov with smtp (Exim 1.90 #1) id 0yr662-0001SM-00; Tue, 30 Jun 1998 14:29:42 -0500 Date: Tue, 30 Jun 1998 14:31:16 -0500 (CDT) From: Guy Helmer Reply-To: Guy Helmer To: Robert Ricci cc: freebsd-questions@FreeBSD.ORG Subject: Re: Full filesystems In-Reply-To: <199806301643.KAA00413@ns2.theonlynet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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