Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2008 11:27:21 -0500
From:      Stephen Clark <sclark46@earthlink.net>
To:        Jille Timmermans <jille@quis.cx>
Cc:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: du and df don't agree
Message-ID:  <491860E9.2020400@earthlink.net>
In-Reply-To: <49185CDB.70702@quis.cx>
References:  <49185ABC.6080004@earthlink.net> <49185CDB.70702@quis.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
Jille Timmermans wrote:
> Probably some file descriptor to an unlinked file is still open.
> The space on disk will be freed when the last descriptor is closed.
> and because there is no file linked to the data, du can't see it.
> 
> (iirc MySQL does this in some situaties when using temp-tables or 
> rebuilding tables)
> 
> -- Jille
> 
> Stephen Clark wrote:
>> Why would du show 630k used by /tmp while df show 161M used
>> by /tmp?
>>
>>
>> # du -sh /tmp
>> 630K    /tmp
>> # df -h
>> Filesystem     Size    Used   Avail Capacity  Mounted on
>> /dev/ad0s1a     94M     41M     45M    47%    /
>> devfs          1.0K    1.0K      0B   100%    /dev
>> /dev/ad0s1e    193M    161M     17M    91%    /tmp
>> ... remaining fs info removed
>>
>> # uname -a
>> FreeBSD 6.1-STABLE FreeBSD 6.1-STABLE
>>
>> I have run fstat /tmp and can't find any files that are using
>> the space that df is claiming as being used.
>>
> 
Thanks, I managed to find the offending process with fstat and kill it.
Now:

Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad0s1e    193M    666K    177M     0%    /tmp


$ du -sh /tmp
682K    /tmp

Regards,
Steve

-- 

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety."  (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases."  (Thomas Jefferson)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?491860E9.2020400>