Re: missing free space
- From: ccostin <ccostin.dmu@xxxxxxxxx>
- Date: Sun, 31 Dec 2006 03:09:34 +0200
On 12/31/06, Roberto C. Sanchez <roberto@xxxxxxxxxxxx> wrote:
On Sun, Dec 31, 2006 at 01:13:30AM +0200, ccostin wrote:
> On a partition mounted as /tmp on /dev/hda2 df report
>
> 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 ?
>
The way that du measure disk utilization is to check for all existing
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.
For this moment I don't run any qemu instace. But is somenthing similar.
When I test an example from php5-imagick package
(/usr/share/doc/php5-imagick/examples/resize.php)
apache2 "eat" a lot of disk space (a bug ?) from tmp
Output from lsof
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
apache2 10673 apache 11u REG 3,2 280080000
0 6161 /tmp/magick-XXuayBEU (deleted)
ls /tmp/magick-XXuayBEU
ls: /tmp/magick-XXuayBEU: No such file or directory
After restarting apache2 all things get back to normal, occupied
space is released.
df -h | grep -E "Size|tmp"
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 479M 9.9M 444M 3% /tmp
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
- Follow-Ups:
- Re: missing free space
- From: Roberto C. Sanchez
- Re: missing free space
- References:
- missing free space
- From: ccostin
- Re: missing free space
- From: Roberto C. Sanchez
- missing free space
- Prev by Date: Looking for music player software
- Next by Date: Re: missing free space
- Previous by thread: Re: missing free space
- Next by thread: Re: missing free space
- Index(es):
Relevant Pages
- Re: missing free space
... and total space used by /tmp directory is ... 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.
... (Debian-User) - RE: system cloning
... Modify the fstab file if there is a difference between the original and ...
>> filesystem from one drive to another, ... >> able to tar up the entire filesystem,
create the raid array, ... To unsubscribe, ... (freebsd-questions) - RE: undo rm deleteing /etc very urgent
... I got the HD and connect it as slave HD and mount it then I ... > filesystem
/etc was stored on. ... And that is to grab the FC install ... To unsubscribe:
http://www.redhat.com/mailman/listinfo/fedora-list -- ... (Fedora) - ext3 Partition 6GB less than underlying logical volume even after resizing using resize2fs
... Just thinking if I should switch to JFS from ext3 since it can be ... Pass 2:
Checking directory structure ... Resizing the filesystem on /dev/vg1/www to 106168320
blocks. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject
of "unsubscribe". ... (Debian-User) - Re: mounting LVM partitions fails after etch upgrade
... > The superblock could not be read or does not describe a correct ext2 ...
Does your root filesystem get ... I can get into a root shell w/o any filesystem
related ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... (Debian-User)