iostat -k units are wrong when using large blocks

Bug #271772 reported by Alain Baeckeroot
4
Affects Status Importance Assigned to Milestone
sysstat (Ubuntu)
Invalid
Undecided
Unassigned
Nominated for Hardy by Alain Baeckeroot

Bug Description

Binary package hint: sysstat

iostat guesses that block are 512 bytes, but with large ext3 filesystems we use 4kB (or more)

=> iostat -k is completely false
$ tune2fs -l /dev/sdb1| grep "Block size"
Block size: 4096

$ iostat #(report in blocks/s)
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sdb 23,14 518,67 411,56 2463660668 1954925512

$ iostat -k #(report _should_ be in kBytes/s)
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sdb 23,14 259,33 205,79 1231830758 977507292

========================
$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04

$ apt-cache policy sysstat
sysstat:
  Installé : 8.0.3-1ubuntu1
  Candidat : 8.0.3-1ubuntu1
 Table de version :
 *** 8.0.3-1ubuntu1 0
        500 http://de.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status
===========================

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Confirmed in Intrepid

Changed in sysstat:
status: New → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

My mistake, iostat is right. What iostat calls a block is a _physical sector_ and this is not the same as a filesystem block.

Also from the FAQ:
3.4. I don't understand the output of iostat. It doesn't match what I expect it
to be...

By default iostat displays I/O activity in blocks per second. With old
kernels (i.e. older than 2.4.x) a block is of indeterminate size and therefore
the displayed values are not useful.
With recent kernels (kernels 2.4 and later), iostat is now able to get disk
activities from the kernel expressed in a number of sectors. If you take a
look at the kernel code, the sector size is actually allowed to vary although
I have never seen anything other than 512 bytes.

In my case hdparm returns
LBA48 user addressable sectors: 488397168
device size with M = 1024*1024: 238475 MBytes (ie 250059161600 bytes)

sector size = 250059161600 / 488397168 = 511.9996

Changed in sysstat:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.