172

I am looking for a Linux command-line tool that would report the disk IO activity. Something similar to htop would be really cool. Has someone heard of something like that?

Servy
  • 202,030
  • 26
  • 332
  • 449
user54579
  • 4,588
  • 4
  • 23
  • 19
  • 7
    Note that you can also do this in `htop`. `Setup >> Select Columns` and choose your combination of `RBYTES`, `WBYTES`, `IO_READ_RATE`, `IO_WRITE_RATE`, and `IO_RATE`. Original answer here http://serverfault.com/a/25034 – joelostblom Feb 19 '16 at 14:40
  • 2
    htop can do it please see second answer – pev.hall Oct 24 '17 at 04:14

4 Answers4

185

You could use iotop. It doesn't rely on a kernel patch. It Works with stock Ubuntu kernel

There is a package for it in the Ubuntu repos. You can install it using

sudo apt-get install iotop

iotop

Anwar
  • 1,755
  • 1
  • 21
  • 32
Egil
  • 5,600
  • 2
  • 32
  • 33
69

nmon shows a nice display of disk activity per device. It is available for linux.

? Disk I/O ?????(/proc/diskstats)????????all data is Kbytes per second??????????????????????????????????????????????????????????????ij
?DiskName Busy  Read WriteKB|0          |25         |50          |75       100|                                                      ?
?sda        0%    0.0  127.9|>                                                |                                                      ?
?sda1       1%    0.0  127.9|>                                                |                                                      ?
?sda2       0%    0.0    0.0|>                                                |                                                      ?
?sda5       0%    0.0    0.0|>                                                |                                                      ?
?sdb       61%  385.6 9708.7|WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                 |                                                      ?
?sdb1      61%  385.6 9708.7|WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                 |                                                      ?
?sdc       52%  353.6 9686.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR   >                  |                                                      ?
?sdc1      53%  353.6 9686.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR   >                  |                                                      ?
?sdd       56%  359.6 9800.6|WWWWWWWWWWWWWWWWWWWWWWWWWWWW>                    |                                                      ?
?sdd1      56%  359.6 9800.6|WWWWWWWWWWWWWWWWWWWWWWWWWWWW>                    |                                                      ?
?sde       57%  371.6 9574.9|WWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                   |                                                      ?
?sde1      57%  371.6 9574.9|WWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                   |                                                      ?
?sdf       53%  371.6 9740.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR    >                 |                                                      ?
?sdf1      53%  371.6 9740.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR    >                 |                                                      ?
?md0        0% 1726.0 2093.6|>disk busy not available                         |                                                      ?
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
  • I tried this, and while the refresh was slow, the graphing of MB/s is too small when dealing with SSD drives (it goes to a scale of 0, 25, 50, 75, and 100 TB/s). I ended up using iotop as its default refresh is fast and actually shows the process killing the I/O. Still a +1 for an option though. – eduncan911 Oct 21 '14 at 15:31
15

It is not htop-like, but you could use atop. However, to display disk activity per process, it needs a kernel patch (available from the site). These kernel patches are now obsoleted, only to show per-process network activity an optional module is provided.

akostadinov
  • 17,364
  • 6
  • 77
  • 85
jpalecek
  • 47,058
  • 7
  • 102
  • 144
  • 1
    this one is shipped with fedora 18 and is working fine for me. Perhaps these patches are already upstream. There is a netatop optional module for per process network activity if one wants that. – akostadinov Mar 29 '13 at 19:36
5

Use collectl which has extensive process I/O monitoring including monitoring threads.

Be warned that there are I/O counters for I/O being written to cache and I/O going to disk. collectl reports them separately. If you're not careful you can misinterpret the data. See http://collectl.sourceforge.net/Process.html

Of course, it shows a lot more than just process stats because you'd want one tool to provide everything rather than a bunch of different one that displays everything in different formats, right?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303