[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird df info




On Thu, 14 Jan 1999, Alex Shnitman wrote:

> 
> I did a small experiment to compare gzip and bzip2, and noticed a very
> strange thing with the reporting of free diskspace. "zz" is just a
> copy of the first 89 MB of /dev/zero. :-) Now look at this:
> 
> alexsh:~> ls -l zz*
> -rw-------   1 alexsh   alexsh   89088000 Jan 14 19:41 zz
> -rw-r--r--   1 alexsh   alexsh       6793 Jan 14 19:49 zz.bz2
> -rw-r--r--   1 alexsh   alexsh      86489 Jan 14 19:42 zz.gz
> alexsh:~> df
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/hda3            3369806 1160824  2174121     35%   /
> /dev/hda1             819056  339904   479152     41%   /dos
> alexsh:~> rm zz*
> alexsh:~> df
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/hda3            3369806 1073388  2261557     32%   /
> /dev/hda1             819056  339904   479152     41%   /dos
> alexsh:~> ls -l zz*
> ls: No match.
> 
> What the hell is going on? Is there some compression the kernel is
> doing on filesystem data that I don't know about? FWIW I'm running
> 2.2.0-pre6. It's not a multiuser system and mine was the only activity
> when I did the experiment. Any ideas? Can anyone try it on their
> system and tell me if they get the same results?

I'm possibly missing something here... lemme recap:

[root@gump ~]# df .
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/hda2            2316190  902352  1294088     41%   /
[root@gump ~]# dd if=/dev/zero of=zz.top bs=1024 count=50000
50000+0 records in
50000+0 records out
[root@gump ~]# ls -l zz.top 
-rw-r--r--   1 root     root     51200000 Jan 14 13:32 zz.top
[root@gump ~]# df .
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/hda2            2316190  952549  1243891     43%   /
[root@gump ~]# rm zz.top 
rm: remove `zz.top'? y   
[root@gump ~]# df .
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/hda2            2316190  902352  1294088     41%   /
[root@gump ~]# bc
bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation,
Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
 1294088 - 1243891
50197
 2261557 - 2174121
87436

here are my 50 megs and here are your 90 megs and chage...

(and please remember that df counts a meg as 1024 blocks of 1024)

what seems to be the problem?

-- 
Ira Abramov ;  whois:IA58  ;  www.scso.com ;  all around Linux enthusiast 
`When you say "I wrote a program that crashed Windows", people just stare
at you blankly and say  "Hey, I got those with the system,  *for free*".'
                                                         (Linus Torvalds)