[mythtv-users] disk usage weirdness <- maybe this is it

Bill Chmura Bill at Explosivo.com
Fri Apr 23 14:35:25 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


For example, a megabyte = 1,048,576 bytes.

So the 54218MB = 56,851,693,568
(Which is similar to the 56G)

But thats where it breaks down... if you convert it to GB like:
56 851 693 568 / 1 073 741 824 = 52.9472656

Its off again.

I took a look at my machine and while I am not sure how Myth approaches it... 
here is what I found:

This is my notebook showing megabytes
wbchmura at loki wbchmura $ df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/hda4                13010     10525      1825  86% /
none                       251         0       251   0% /dev/shm

13 010 * 1 048 576 = 13 641 973 760 (Number of bytes)

This is how many GB df reports
wbchmura at loki wbchmura $ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda4              13G   11G  1.8G  86% /
none                  251M     0  251M   0% /dev/shm

However if I actually did out the conversion to GB it would not be 13, it 
would be 12 
(13 010 * 1 048 576) / 1 073 741 824 = 12.7050781

So I am guessing DF just truncates, and thats why you have a discrepency

Before I get flamed, I stress the Guess above...

Bill

On Friday 23 April 2004 10:45 am, Dennis Lou wrote:
> From: Henk Poley <hpoley at dds.nl>
>
> >Op vrijdag 23 april 2004 05:37, schreef Dennis Lou:
> >> I noticed that the backend status reports disk
> >> usage differently than df.
> >>
> >> This is what mythbackend reports:
> >>  Disk Usage:
> >>     * Total Space: 54,218 MB
> >>     * Space Used: 49,745 MB
> >>     * Space Free: 4,473 MB
> >>
> >> and this is what df -h reports:
> >> [root at localhost /]# df -h
> >> Filesystem            Size  Used Avail Use% Mounted
>
> on
>
> >> /dev/hda2              56G   46G  7.3G  87% /
> >> /dev/hda1              99M   14M   80M  15% /boot
> >> none                  125M     0  125M   0%
>
> /dev/shm
>
> >Linux automagicaly reserves some space to keep
> >fragmentation low. Only root
> >can use that (that's why df as root reports the full
> >free space). It has been
> >on the list before. There's also some command to
> >disable this barrier for
> >normal users also (don't know if that's smart
>
> though).
>
> Hm, hadn't seen it on the list before...
>
> In any case, df as root gives the same result as
> df as normal user:
>
> $ df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/hda2              56G   48G  5.8G  90% /
> /dev/hda1              99M   14M   80M  15% /boot
> none                  125M     0  125M   0% /dev/shm
> $ su
> Password:
> [root at localhost dlou]# df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/hda2              56G   48G  5.8G  90% /
> /dev/hda1              99M   14M   80M  15% /boot
> none                  125M     0  125M   0% /dev/shm
>
> Even if you do the math and adjust by 5%, it still
> doesn't add up.  Space used is space used.  No
> matter the reserve, that particular figure
> shouldn't be different.
>
> Then there's this weirdness:
> # du -sh /
> 30G     /
>
> -Dennis
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> http://photos.yahoo.com/ph/print_splash

- -- 

Bill Chmura

w. http://www.fistfullofcode.com
w. http://www.explosivo.com

- ------------------------------------------------------

"No matter what, never, ever, ever, ever tell your girl friend she is looking 
a little puffy."
- -Ancient chinese proverb

"Some people go to bed with Lucifer, then they cry when they don't greet the 
day with God"
- -Monster Magnet

Without good motivation, science and technology, instead of helping, bring 
more fear and threaten global destruction. Compassionate thought is very 
important for humankind.
- -His Holiness the Dalai Lama

- -------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAiWHtEEA64RcvcRERAgtiAJ479A524U8I30VG0lplGECti0rL/wCeMaZR
ArYvqyogBllIWm5SJ/j/jno=
=nGh9
-----END PGP SIGNATURE-----


More information about the mythtv-users mailing list