54

How do I view my Disk Activity on Ubuntu? For example, How can I monitor what is being written and read from disk as well as the percentage of disk usage?

I am looking for an application similar to the Resource Monitor in Windows.

63

You can use iotop. To install, open a terminal and execute the following command:

sudo apt-get install iotop

To use iotop, open a terminal and type the following command:

sudo iotop

iotop features real-time display of all disk activity and also displays the command responsible for the activity and the user behind the command just like Resource Monitor.

Click here for more information.

enter image description here

Also similar to resource monitor is htop in it's ability to identify and kill processes:

sudo apt-get install htop

and to run htop in monitor mode:

htop

or, for more features and permissions to fully debug and kill individual processes etc.:

sudo htop

enter image description here

  • 1
    too difficult, I need only one value - 0-100% DISK Usage... – user25 May 28 '18 at 10:14
  • 4
    you were asking for disk activity, not disk usage. This is the perfect answer to your question. – xorinzor Sep 13 '18 at 17:18
33

You can use htop.

sudo apt install htop

Then open htop and configure it: F2 -> Columns -> Set IO_RATE (or IO_RATE_READ/IO_RATE_WRITE) -> F10

And you will see something like this:

screenshot

  • 2
    This should be the answer to the question! – Socrates Apr 27 '18 at 12:02
  • super. this is correct answer. – James M Jun 28 '18 at 10:29
  • Your screen shot shows DISK R/W, but I don't see that in htop. What's the difference between DISK R/W and IO_RATE, IO_RATE_READ/IO_RATE_WRITE? – user3731622 Nov 7 '18 at 1:06
  • DISK R/W appears when you choose IO_RATE column in setup . IO_RATE is a total I/O (read and write) in bytes per second. – RedEyed Nov 7 '18 at 17:54
15

You can try nmon

sudo apt-get install nmon

Try:

nmon

Output Like below:

enter image description here

Press d = Disk | Press c = CPU Info |Press r = RAM info | Press q = to exit
9

You can use dstat program. To install it, simply execute the command in a terminal

sudo apt-get install dstat

Using the dstat command, you will get a complete real time CPU/Network/Disk-Activity monitoring view like this

mas@mas-laptop:~ > dstat 
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
 15   5  76   4   0   0| 181k  177k|   0     0 |   0    61B|1651  3609 
  5   0  95   0   0   0|   0     0 | 162B 1064B|   0     0 | 500   994 
 15   4  77   4   0   0|   0   292k| 302B   52B|   0     0 | 687  1919 
  6   1  92   1   0   0|   0     0 |   0     0 |   0     0 | 496  1089 
  5   1  94   1   0   1|   0     0 |   0     0 |   0     0 | 422   919
  6   1  93   1   0   0|   0     0 |   0     0 |   0     0 | 517  1181 
  9   2  89   1   0   1|   0     0 |   0     0 |   0     0 | 494  1066

To only get the usage info for disk for load indicator upto most recent 15 mintues, use dstat --disk --fs --load command. A sample output is given below

$ dstat --disk --fs

-dsk/total- --filesystem- ---load-avg---
 read  writ|files  inodes| 1m   5m  15m 
 895k  186k|13728    100k|0.63 0.73 0.84
   0     0 |13728    100k|0.63 0.73 0.84
   0     0 |13728    100k|0.63 0.73 0.84
   0     0 |13728    100k|0.63 0.73 0.84
   0    12k|13728    100k|0.66 0.74 0.84
   0     0 |13728    100k|0.66 0.74 0.84
   0     0 |13728    100k|0.66 0.74 0.84
   0     0 |13728    100k|0.66 0.74 0.84
   0     0 |13728    100k|0.66 0.74 0.84^C

dstat --help has these info:

Usage: dstat [-afv] [options..] [delay [count]]
Versatile tool for generating system resource statistics

Dstat options:
  -c, --cpu              enable cpu stats
     -C 0,3,total           include cpu0, cpu3 and total
  -d, --disk             enable disk stats
     -D total,hda           include hda and total
  -g, --page             enable page stats
  -i, --int              enable interrupt stats
     -I 5,eth2              include int5 and interrupt used by eth2
  -l, --load             enable load stats
  -m, --mem              enable memory stats
  -n, --net              enable network stats
     -N eth1,total          include eth1 and total
  -p, --proc             enable process stats
  -r, --io               enable io stats (I/O requests completed)
  -s, --swap             enable swap stats
     -S swap1,total         include swap1 and total
  -t, --time             enable time/date output
  -T, --epoch            enable time counter (seconds since epoch)
  -y, --sys              enable system stats

  --aio                  enable aio stats
  --fs, --filesystem     enable fs stats
  --ipc                  enable ipc stats
  --lock                 enable lock stats
  --raw                  enable raw stats
  --socket               enable socket stats
  --tcp                  enable tcp stats
  --udp                  enable udp stats
  --unix                 enable unix stats
  --vm                   enable vm stats

  --plugin-name          enable plugins by plugin name (see manual)
  --list                 list all available plugins

  -a, --all              equals -cdngy (default)
  -f, --full             automatically expand -C, -D, -I, -N and -S lists
  -v, --vmstat           equals -pmgdsc -D total

  --float                force float values on screen
  --integer              force integer values on screen

  --bw, --blackonwhite   change colors for white background terminal
  --nocolor              disable colors (implies --noupdate)
  --noheaders            disable repetitive headers
  --noupdate             disable intermediate updates
  --output file          write CSV output to file

delay is the delay in seconds between each update (default: 1)
count is the number of updates to display before exiting (default: unlimited)

For more information about this tool, look visit below links:

1) Dstat home page

2) DiskPerformance Community Documentation Page

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.