From owner-freebsd-questions Sun Nov 16 14:12:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA18973 for questions-outgoing; Sun, 16 Nov 1997 14:12:45 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from smtp1.xs4all.nl (smtp1.xs4all.nl [194.109.6.51]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA18959 for ; Sun, 16 Nov 1997 14:12:20 -0800 (PST) (envelope-from plm@muon.xs4all.nl) Received: from asterix.xs4all.nl (root@asterix.xs4all.nl [194.109.6.11]) by smtp1.xs4all.nl (8.8.6/XS4ALL) with ESMTP id XAA29622 for ; Sun, 16 Nov 1997 23:12:09 +0100 (MET) Received: from muon.xs4all.nl (uucp@localhost) by asterix.xs4all.nl (8.8.6/8.8.6) with UUCP id XAA00778 for freebsd-questions@freebsd.org; Sun, 16 Nov 1997 23:03:48 +0100 (MET) Received: (from plm@localhost) by muon.xs4all.nl (8.8.7/8.7.3) id OAA12060; Sun, 16 Nov 1997 14:26:11 +0100 (MET) To: freebsd-questions@freebsd.org Subject: Re: full file system: df and du disagree - why? References: <873ekx3ul5.fsf@totally-fudged-out-message-id> From: Peter Mutsaers Date: 16 Nov 1997 14:26:11 +0100 In-Reply-To: Doug White's message of Fri, 14 Nov 1997 17:30:10 -0800 (PST) Message-ID: <87vhxt0y30.fsf@muon.xs4all.nl> Lines: 33 X-Mailer: Gnus v5.5/Emacs 20.2 Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> On Fri, 14 Nov 1997 17:30:10 -0800 (PST), Doug White >> said: DW> On Fri, 14 Nov 1997, Charles Owens wrote: >> > > A 'du -ks /var' showed that only 11 out of 60 megs were in >> > > use, so I _knew_ that there was plenty of free space. But, >> > > df didn't think so, and the kernel apparantly didn't think >> > > so either, as writes to /var still produced a filesystem >> > > full error. >> > >> > Some process has a file that has been rm'ed open, likely. >> > The file is not actually deleted until the last process that >> > has it open closes it. Du will report the space as unused, >> > df will report correctly. >> >> Thanks! Could you define "rm'd open" ? DW> Under UNIX, files have a `link count' associated with them. DW> WHen you create a file on a filesystem, it gets one link to DW> the FS. When a program opens a file, the link count is DW> incremented. When a program closes a file or you use the DW> rm(1) command, the link count is reduced by one. When the DW> link count reaches 0, the index node (inode) is cleared, the DW> disk's block free list is updated and the file is forgotten. Huh?!? Aren't you mixing up the link count that is kept for links in the filesystem (i.e. hard links) and some other count that keeps track of the number of processes that opened the file? -- /\_/\ ( o.o ) Peter Mutsaers | Abcoude (Utrecht), | Trust me, I know ) ^ ( plm@xs4all.nl | the Netherlands | what I'm doing.