I've read a whole bunch of posts regarding methods of capturing disk IO on Linux, however none of them have answered the source of my confusion.
In my case, I am monitoring disk IO on Linux using SNMP (diskIOTable), which returns me data for a number of devices from a system. For instance, on my reference system I have records for the disk
sda, the boot partition
sda1, the root partition
sda2, the LVM logical volume
dm-0, and the LVM logical volume of my swap,
When calculating disk IO for the system, how do these various elements interact? I was at first assuming that statistics for a disk,
sda, would include the statistics reported by the partition
sda1, however I am seeing a large discrepancy between the stats reported for
sda1 even when
sda1 is the only partition on the disk. This is further evident when I start looking at systems with multiple partitions, for instance one would assume that
sda1 + sda2 == sda, however this does not always seem to be the case (although on some systems it's close). Almost always, the stats reported by the disk exceed the stats reported by the partition, or by the summation of stats reported by all of a disk's partitions.
And how do the
dm-* devices factor in?
Is it reasonable to assume that ignoring partitions and logical devices like
ram*, and summing the IO statistics for real disks only, I can accurately describe the aggregate IO (for each bytes and ops) of a given system?
reads(sda) + reads(sdb) + reads(sdc) == reads(host)
Or am I missing something?