Skip site navigation (1)Skip section navigation (2)
Date:      16 Nov 1997 14:26:11 +0100
From:      Peter Mutsaers <plm@xs4all.nl>
To:        freebsd-questions@freebsd.org
Subject:   Re: full file system: df and du disagree - why?
Message-ID:  <87vhxt0y30.fsf@muon.xs4all.nl>
In-Reply-To: Doug White's message of Fri, 14 Nov 1997 17:30:10 -0800 (PST)
References:  <873ekx3ul5.fsf@totally-fudged-out-message-id>

next in thread | previous in thread | raw e-mail | index | archive | help
>> On Fri, 14 Nov 1997 17:30:10 -0800 (PST), Doug White
>> <dwhite@gdi.uoregon.edu> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87vhxt0y30.fsf>