0

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, dm-1.

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 sda and 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 dm-*, md*, loop*, 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?

  • You can have IO to a disk without going through the partition(s). Thus sda1 + sda2 <= sda – Patrick Jul 8 '16 at 4:10
  • I figured as such, based on the numbers. What kind of operations go straight to disk? I know LVM can be configured to use a raw disk without partitions, and ZFS as well. Looks like this may be more common on reads, as the write stats typically add up. – GROND Jul 8 '16 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.