You can use the tool
iostat to collect the disk utilization information. It takes several arguments, including the switch,
-d Display the device utilization report.
It also takes an argument in seconds an interval of how frequent it should re-run. The value
3600 would be the number of seconds in an hour.
$ iostat -d 3600
Linux 220.127.116.11-106.fc14.x86_64 (grinchy) 09/04/2013 _x86_64_ (4 CPU)
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 20.53 71.86 1259.61 20308334 356000380
dm-0 4.92 39.02 28.81 11027610 8143376
dm-1 0.54 0.93 3.38 261472 954912
dm-2 156.65 31.87 1227.42 9006394 346902056
The output from this command could be redirected to a file:
$ iostat -d 3600 >> iostat_hrly.log
Meaning of the units
If you consult the man page for
iostat it has pretty good descriptions of the units.
Indicate the amount of data read from the device expressed in a
number of blocks per second. Blocks are equivalent to sectors with
kernels 2.4 and later and therefore have a size of 512 bytes. With
older kernels, a block is of indeterminate size.
Indicate the amount of data written to the device expressed in a
number of blocks per second.
The total number of blocks read.
The total number of blocks written.
So a block is 512 bytes, so the Blk_read/s in terms of MB for device
sda would be, 71.86 * 512 bytes = 36.79232 kilobytes/sec.
There are additional switches that will change the units automatically in the output.
iostat man page
-h Make the NFS report displayed by option -n easier to read by a human.
-k Display statistics in kilobytes per second instead of blocks per
second. Data displayed are valid only with kernels 2.4 and later.
-m Display statistics in megabytes per second instead of blocks or
kilobytes per second. Data displayed are valid only with kernels
2.4 and later.
Example in KB/s
So this might be more useful, showing the throughput in KB/s:
$ iostat -dk 3600
Linux 18.104.22.168-106.fc14.x86_64 (grinchy) 09/05/2013 _x86_64_ (4 CPU)
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 20.85 47.25 663.81 15475096 217427086
dm-0 5.01 20.00 14.43 6549301 4725068
dm-1 0.54 0.58 1.60 189064 524872
dm-2 165.30 26.65 647.78 8730281 212177124