I have a machine that runs few services, but I don’t believe they are responsible for sometimes heavy disk access on this server (massive head moving which I can hear, after long periods of almost no movement)
How can I find out which process is doing something on the hard disk when there is such a period again?
I was thinking to use the linux command “lsof”, but it has overwhealming output and options, so I can’t see anything.
Can you guide me how would I
- show only hard disk access
- that is really physicaly currently happing (not buffered or only opened files, actually physical reading or writing)
- maybe sort or filter by user or process
Would be great if you could demonstrate some useful options of lsof for such a case. Thank you.
Edit Thank you for all answers. This is much more than I expected and I upvoted all answers (until today)
Try looking at “iotop“. It will give you just what you need, a per process IO usage, top like, display.
Comes with most modern linux distributions
Check more discussion of this question.