Sometimes, especially upon login, I have a lot of disk activity. I can use iotop to see what's doing that at a given moment, but I would like to have an integral table over a given time, say the first 5 minutes after I run it.

I'm interested in the percentage breakdown of the disk activity each program was using over the 5 minutes in total.

Is there a tool or a simple script I can run for that cause?


1 Answer 1


You can use iotop -b (batch mode) inside of a loop based on # of seconds.

That will spit out everything and then redirect it to a file.

I'm trying to find a shell loop example to do that but i don't do shell programming much.

If i started the command by hand, i would run: iotop -botqk > ~/log-iotop.txt or something similar.

  • Output to a file is handy, but I only need the "last screen" of the iotop -a cummulative output, as @StéphaneChazelas suggested.
    – Sparkler
    Commented Dec 8, 2014 at 16:15
  • 1
    I think iotop -abtqk might be what you're looking for -- it will output everything for you with timestamps and when 5 minutes are up, press Ctrl C and it will stop. Then you have everything of the last 5 minutes on your screen that you can scroll through.
    – Roger B
    Commented Dec 8, 2014 at 16:31
  • 1
    using -abtqk produces duplicates in the ouput and a very large file. it is kinda useful though.
    – Sparkler
    Commented Dec 8, 2014 at 16:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .