Bug#319836: di: wrong calulation of totals

2005-07-25 Thread Miernik
Package: di
Version: 3.11.dfsg.1-1
Severity: normal

Sometimes the lines in Total are wrong, for example:

szrenica:~# di -t
Filesystem Mount   Megs UsedAvail %used fs Type
/dev/hda1  /  249.9188.1 48.5  81%  ext3
tmpfs  /dev/shm77.9  0.0 77.9   0%  tmpfs
/dev/hda9  /home  710.6577.9132.6  81%  jfs
/dev/hda8  /tmp   161.7  4.0149.0   8%  ext3
/dev/hda5  /usr   745.9540.5167.6  78%  ext3
/dev/hda6  /var/cache/wwwo   1278.5793.2485.3  62%  reiserfs
   Total 2400.7   1563.3815.4  66%
szrenica:~#

The totals should be:3224.5   2099.7   1060.9

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (50, 'experimental')
Architecture: i386 (i586)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-1-386
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages di depends on:
ii  libc6 2.3.5-2GNU C Library: Shared libraries an

di recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319836: di: wrong calulation of totals

2005-07-25 Thread Michael Ablassmeier
tags 319836 + unreproducible
tags 319836 + moreinfo 
thanks

hi Miernik,

On Mon, Jul 25, 2005 at 06:46:34AM +0200, Miernik wrote:
 Sometimes the lines in Total are wrong, for example:
 
 szrenica:~# di -t
 Filesystem Mount   Megs UsedAvail %used fs Type
 /dev/hda1  /  249.9188.1 48.5  81%  ext3
 tmpfs  /dev/shm77.9  0.0 77.9   0%  tmpfs
 /dev/hda9  /home  710.6577.9132.6  81%  jfs
 /dev/hda8  /tmp   161.7  4.0149.0   8%  ext3
 /dev/hda5  /usr   745.9540.5167.6  78%  ext3
 /dev/hda6  /var/cache/wwwo   1278.5793.2485.3  62%  reiserfs
Total 2400.7   1563.3815.4  66%
 szrenica:~#
 
 The totals should be:3224.5   2099.7   1060.9

not really, di doesnt count virtual filesystems like tmpfs etc, so
-77.9. It seems like di lost your /dev/hda5: 3224.5-77.9-2400.7=745.9

Im unable to reproduce this behavior on one of my machines. Could you
please try to run di with option `-x 5' and attach its debug output to
this bugreport, thanks.

bye,
- michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319836: di: wrong calulation of totals

2005-07-25 Thread Miernik
On Mon, Jul 25, 2005 at 09:44:19AM +0200, Michael Ablassmeier wrote:
 It seems like di lost your /dev/hda5: 3224.5-77.9-2400.7=745.9
 
 Im unable to reproduce this behavior on one of my machines. Could you
 please try to run di with option `-x 5' and attach its debug output to
 this bugreport, thanks.

Attached. Now I repartitioned my drive a bit, but it still doesn't count
hda5.

-- 
Miernik _  xmpp:[EMAIL PROTECTED]
___/___/  mailto:[EMAIL PROTECTED]
Protect Europe from a legal disaster. Petition against software patents
http://www.noepatents.org/index_html?LANG=en
di ver 3.11
i:0 size:  1024.00 KBytes 
i:1 size: 1048576.00 Megs 
i:2 size: 1073741824.00 Gigs 
i:3 size: 1099511627776.00 Teras 
i:4 size: 1125899906842624.00 Petas 
i:5 size: 1152921504606846976.00 Exas 
i:6 size: 1180591620717411303424.00 Zettas 
i:7 size: 1208925819614629174706176.00 Yottas 
dispBlockSize: 1048576.00
i:0 suffix:   low: 0.00 high:  1024.00 dbs: 1.00 
i:1 suffix: k low:  1024.00 high: 1048576.00 dbs:  1024.00 
i:2 suffix: M low: 1048576.00 high: 1073741824.00 dbs: 1048576.00 
i:3 suffix: G low: 1073741824.00 high: 1099511627776.00 dbs: 1073741824.00 
i:4 suffix: T low: 1099511627776.00 high: 1125899906842624.00 dbs: 
1099511627776.00 
i:5 suffix: P low: 1125899906842624.00 high: 1152921504606846976.00 dbs: 
1125899906842624.00 
i:6 suffix: E low: 1152921504606846976.00 high: 1180591620717411303424.00 dbs: 
1152921504606846976.00 
i:7 suffix: Z low: 1180591620717411303424.00 high: 1208925819614629174706176.00 
dbs: 1180591620717411303424.00 
i:8 suffix: Y low: 1208925819614629174706176.00 high: 
1237940039285380274899124224.00 dbs: 1208925819614629174706176.00 
# lib:getDiskEntries: get/set/endmntent
mnt:/ - /dev/hda1 : ext3
mnt:/proc - proc : proc
mnt:/sys - sysfs : sysfs
mnt:/dev/pts - devpts : devpts
mnt:/dev/shm - tmpfs : tmpfs
mnt:/tmp - /dev/hda8 : ext3
mnt:/usr - /dev/hda5 : ext3
mnt:/var/cache/wwwoffle - /dev/hda6 : reiserfs
mnt:/home/miernik - /dev/mapper/miernik : ext3
# lib:getDiskInfo: statvfs
/: ext3
bsize:1024  frsize:1024
blocks: tot:260390982510504 free:4398046558078 avail:1099133670654976
inodes: tot:520597281052000 free:4398046632315 avail:1099133670654976
/proc: proc
bsize:4096  frsize:4096
blocks: tot:0 free:17592186044416 avail:4096
inodes: tot:0 free:17592186044416 avail:4096
/sys: sysfs
bsize:4096  frsize:4096
blocks: tot:0 free:17592186044416 avail:4096
inodes: tot:0 free:17592186044416 avail:4096
/dev/pts: devpts
bsize:4096  frsize:4096
blocks: tot:0 free:17592186044416 avail:4096
inodes: tot:0 free:17592186044416 avail:4096
/dev/shm: tmpfs
bsize:4096  frsize:4096
blocks: tot:85680302607853 free:17592186064365 avail:85680302592000
inodes: tot:85676007640557 free:17592186064364 avail:85680302592000
/tmp: ext3
bsize:1024  frsize:1024
blocks: tot:693392405333710 free:4398046663713 avail:711169274807296
inodes: tot:379357281474848 free:4398046599430 avail:711169274807296
/usr: ext3
bsize:4096  frsize:4096
blocks: tot:225709121530349 free:17592186087272 avail:820154069946368
inodes: tot:268418276225088 free:17592186106912 avail:820154069946368
/var/cache/wwwoffle: reiserfs
bsize:4096  frsize:4096
blocks: tot:533233075027589 free:17592186168569 avail:1405747090952192
inodes: tot:0 free:17592186044416 avail:1405747090952192
/home/miernik: ext3
bsize:1024  frsize:1024
blocks: tot:362224657076087 free:4398046583393 avail:1002166194013184
inodes: tot:241059334515776 free:4398046567230 avail:1002166194013184
special dev: /dev/hda1: 769 rdev: 769
special dev: /dev/hda8: 769 rdev: 776
special dev: /dev/hda5: 769 rdev: 773
special dev: /dev/hda6: 769 rdev: 774
special dev: /dev/mapper/miernik: 769 rdev: 65024
chk: / free: 60627
chk: / total: 255912
chk: /proc free: 0
chk: /proc total: 0
chk: ignore: totalBlocks = 0: /proc
chk: /sys free: 0
chk: /sys total: 0
chk: ignore: totalBlocks = 0: /sys
chk: /dev/pts free: 0
chk: /dev/pts total: 0
chk: ignore: totalBlocks = 0: /dev/pts
chk: /dev/shm free: 19949
chk: /dev/shm total: 19949
chk: /tmp free: 161443
chk: /tmp total: 165582
chk: /usr free: 52552
chk: /usr total: 190957
chk: /var/cache/wwwoffle free: 124153
chk: /var/cache/wwwoffle total: 327301
chk: /home/miernik free: 84337
chk: /home/miernik total: 25
dup: chk: i: / dev: 769 rdev: 769 dup: 5
chk: dup: not checked: /proc prnt: 0 dev: 0 rdev: 0
chk: dup: not checked: /sys prnt: 0 dev: 0 rdev: 0
chk: dup: not checked: /dev/pts prnt: 0 dev: 0 rdev: 0
chk: dup: not checked: /dev/shm prnt: 1 dev: 0 rdev: 0
dup: chk: i: /tmp dev: 769 rdev: 776 dup: 0
dup: chk: i: /usr dev: 769 rdev: 773 dup: 0
dup: chk: i: /var/cache/wwwoffle dev: 769 rdev: 774 dup: 0
dup: chk: i: /home/miernik dev: 769 rdev: 65024 dup: 0
Filesystem   

Bug#319836: di: wrong calulation of totals

2005-07-25 Thread Michael Ablassmeier
hi Miernik,

On Mon, Jul 25, 2005 at 11:43:52AM +0200, Miernik wrote:
 On Mon, Jul 25, 2005 at 09:44:19AM +0200, Michael Ablassmeier wrote:
  It seems like di lost your /dev/hda5: 3224.5-77.9-2400.7=745.9
  
  Im unable to reproduce this behavior on one of my machines. Could you
  please try to run di with option `-x 5' and attach its debug output to
  this bugreport, thanks.
 
 Attached. Now I repartitioned my drive a bit, but it still doesn't count
 hda5.

Thanks. Hmm.. just out of curiosity, whats the output `di -t /usr/'?
Does /etc/fstab contain any mount options (besides default) for /usr? 

bye,
- michael


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319836: di: wrong calulation of totals

2005-07-25 Thread Michael Ablassmeier
tags 319836 + wontfix
retitle 319836 doesn't add read-only mounted devices to totals
thanks 

hi again,

On Mon, Jul 25, 2005 at 01:09:27PM +0200, Miernik wrote:
 On Mon, Jul 25, 2005 at 12:53:13PM +0200, Michael Ablassmeier wrote:
  Thanks. Hmm.. just out of curiosity, whats the output `di -t /usr/'?
  Does /etc/fstab contain any mount options (besides default) for /usr? 

 [..]
 
 Maybe the read-only is the problem?
 Yes, when I remount it rw, it is OK:
 
 szrenica:~$ di -t /usr/
 Filesystem Mount   Megs UsedAvail %used fs Type
 /dev/hda5  /usr   745.9540.6167.4  78%  ext3
Total  745.9540.6167.4  78%

there we go! Seems like this is intended, thought. Heres the code:

 /* only total the disks that make sense! */
 /* don't add memory filesystems to totals. */
 if (diskInfo [i].printFlag == DI_PRNT_OK 
strcmp (diskInfo [i].fsType, tmpfs) != 0 
strcmp (diskInfo [i].fsType, mfs) != 0 
diskInfo [i].isReadOnly == FALSE)
{
addTotals (diskInfo [i], totals);
}

so, disks which are mounted read only are not added to the totals
information, which makes (at least sort of) sense to me. This is not
mentioned in the Manpage, i'm going to forward this bugreport to
upstream and ask about it. Patch attached. Until response by upstream,
im setting the report to wontfix.. Thanks for your report and time.

bye,
- michael
--- di-3.11.dfsg.1.orig/di.c2004-03-16 22:28:07.0 +0100
+++ di-3.11.dfsg.1/di.c 2005-07-25 13:25:49.0 +0200
@@ -670,8 +670,8 @@
 /* don't add memory filesystems to totals. */
 if (diskInfo [i].printFlag == DI_PRNT_OK 
 strcmp (diskInfo [i].fsType, tmpfs) != 0 
-strcmp (diskInfo [i].fsType, mfs) != 0 
-diskInfo [i].isReadOnly == FALSE)
+strcmp (diskInfo [i].fsType, mfs) != 0
+)
 {
 addTotals (diskInfo [i], totals);
 }


Bug#319836: di: wrong calulation of totals

2005-07-25 Thread Miernik
On Mon, Jul 25, 2005 at 12:53:13PM +0200, Michael Ablassmeier wrote:
 Thanks. Hmm.. just out of curiosity, whats the output `di -t /usr/'?
 Does /etc/fstab contain any mount options (besides default) for /usr? 

szrenica:~$ di -t /usr/
Filesystem Mount   Megs UsedAvail %used fs Type
/dev/hda5  /usr   745.9540.6167.4  78%  ext3
   Total0.0  0.0  0.0   0%
szrenica:~$ cat /etc/fstab | grep usr | tr -s ' \t'
/dev/hda5   /usrext3ro  0 2
szrenica:~$

Maybe the read-only is the problem?
Yes, when I remount it rw, it is OK:

szrenica:~$ di -t /usr/
Filesystem Mount   Megs UsedAvail %used fs Type
/dev/hda5  /usr   745.9540.6167.4  78%  ext3
   Total  745.9540.6167.4  78%

-- 
Miernik _  xmpp:[EMAIL PROTECTED]
___/___/  mailto:[EMAIL PROTECTED]
   Save Europe from Software Patents
http://www.gnu.org/philosophy/savingeurope.html


pgpDmlMPP9Rlo.pgp
Description: PGP signature