Does vmstat -d give a count of actual physical writes/reads done to/from hard disk?

Hi,

I am trying to find the reliability of 'vmstat -d' for showing the actual physical writes on sectors on hard disk.

Can anyone please tell me if the numbers in the "sectors" field under "read" or "write" headers show a count of the actual write commands sent to disk from the low level driver?

More precisely, from this number, say n, can we be sure that n sectors on disk have been physically written to?:confused:

Well, if you're using Linux, you can look at the sysstat code, which probably does some kind of ioctl on the raw device, and so you could look at the Linux kernel, which might end up telling you that it counts the number of blocks sent to the IO controller for writing; whether or not that means the device actually wrote those blocks, I don't think one can say.

Now it could be that the disk and its controller keep track of a statistic and it's possible to get that value, but I doubt this is what sa/sysstat relies on. Further, I've written SCSI drivers before, and if this feature exists nowadays, it's not in the standard, meaning it's on a device-by-device basis.

I used to think that whatever blocks the block layer sends down to the device driver to write actually does get written, even if the 2 writes are for the same LBA. (By calling a sync between 2 writes to the same area on the disk). My doubt is that does monmitoring IO stats from iostat, vmstat, proc/diskstats or /sys/sda/stat, give a count of the num ber of blocks sent to the disk for write?