Re: missing free space
- From: "Roberto C. Sanchez" <roberto@xxxxxxxxxxxx>
- Date: Sat, 30 Dec 2006 18:37:47 -0500
On Sun, Dec 31, 2006 at 01:13:30AM +0200, ccostin wrote:
On a partition mounted as /tmp on /dev/hda2 df reportThe way that du measure disk utilization is to check for all existing
df -h | grep -E "Size|hda2"
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 479M 454M 0 100% /tmp
and total space used by /tmp directory is
du -sh /tmp/
1.4M /tmp/
Why this differences between used space reported df and du appear ?
files and directories and see how many disk blocks they use and add them
all up. OTOH, df checks with the filesystem to see how many blocks are
not used. You are asking why the sum of blocks used by existing files
and directories and the unused blocks is not the whole of the blocks in
the filesystem. The reason is that there are nonexistent files.
What that means is that a program needs a temporary file and so it calls
a function like tmpfile, which creates a temporary file. In order to
minimize the vulnerability of information leaking from a temporary file,
some programs call unlink() right after the file is created. As long as
the program retains the open file descriptor, the file can be read from
and written to, but no one else can access it, since it is not
addressable via the filesystem. Once the program closes, the file
descriptor is reclaimed by the OS and all the blocks are again marked as
free.
I believe that qemu does this as I often see the exact same thing you
are talking about after laeving qemu running for long periods of time.
Regards,
-Roberto
--
Roberto C. Sanchez
http://people.connexer.com/~roberto
http://www.connexer.com
Attachment:
signature.asc
Description: Digital signature
- Follow-Ups:
- Re: missing free space
- From: ccostin
- Re: missing free space
- References:
- missing free space
- From: ccostin
- missing free space
- Prev by Date: Re: update messages
- Next by Date: Re: John the Ripper in Etch?
- Previous by thread: missing free space
- Next by thread: Re: missing free space
- Index(es):
Relevant Pages
- Re: missing free space
... df checks with the filesystem to see how many blocks are ... What that means
is that a program needs a temporary file and so it calls ... are talking about after laeving
qemu running for long periods of time. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". ... (Debian-User) - Re: What is an "anonymous temporary file?" (question about PerlFAQ5)
... > it is a "file" in memory only. ... It is an actual file on an actual filesystem,
... > of an actual disk-based temporary file in the usual places (/tmp, ... linux
automatically cleans them up. ... (comp.lang.perl.misc) - Re: Harddisk Problem
... and you come up with 28.8G total space with -h but you ... manufacturers show
their drives with 1,000,000 bytes equalling 1MB, ... Filesystem Size Used Avail
Capacity Mounted on ... > Dedicated Server on FreeBSD 4.8 and look what it gives: ...
(freebsd-isp) - Re: diary with encryption
... > That's what I would suggest, except that I'd use encfs instead of cfs. ...
temporary files on an unencrypted filesystem. ... specify the temporary file directory,
and/or they respect $TMP, so make ... (Debian-User) - What is an "anonymous temporary file?" (question about PerlFAQ5)
... >>> How do I make a temporary file name? ... What is an "anonymous
temporary file?" ... it is a "file" in memory (or virtual memory) only. ...
is this an actual file on an actual filesystem? ... (comp.lang.perl.misc)