LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Monitoring HDD access (https://www.linuxquestions.org/questions/linux-general-1/monitoring-hdd-access-514454/)

dudds 12-28-2006 08:48 PM

Monitoring HDD access
 
Hi Everyone,

I just had an issue with my PC where it was running EXTREMELY slow for a period of time. I noticed that for some reason my HDD was going at 100 miles per hour and wanted to know which process was accessing it. I tried 'top' but it just shows CPU usage which was quite minimal. Any other utilities I could try?

macemoneta 12-28-2006 08:56 PM

There are two processes that tend to run periodically that kill performance if they are on your distribution - prelink and beagle. Prelink is pretty much only a problem after the system is installed for a while. Beagle is literally a dog, and I recommend uninstalling it.

stress_junkie 12-28-2006 09:04 PM

Use the lsof command to see what processes are using what files. You can also use the fuser command but lsof is more general. If you wanted to see what processes are using what files on the root partition then the following command would do the trick.
Code:

lsof /
Then you can use the ps command with the ASCII forest output format to see the parent process of the child running whatever command you are interested in diagnosing.
Code:

ps fx
If you can't see the ends of the lines then use the --width parameter to tell ps that you are using a 132 column terminal. That will cause ps to write the entire line and wrap the output.
Code:

ps --width 132 fx

dudds 12-29-2006 12:54 AM

Thanks guys for those suggestions. But what I was thinking is that if I see my HDD access light hard on then some process must be accessing the drive to either perform a read or write operation so what I was looking for was a command to see possibly the amount of IO a process was using, or the percentage of time it was waiting for i/o etc. Is there anything like that? I'll keep searching.

stress_junkie 12-29-2006 08:21 AM

If you have the sysstat Linux utilities installed then you have a few tools to view this sort of thing. You can use iostat, vmstat, and sar to interactively monitor disk activity. You can also use the sar data collector to run periodically and store the information to a file. You can then use the sar utility to analyze the data file.

I would include the instructions to configure the sar data collector but unfortunately the machine where I have set this up is broken. I'm currently writing endless blocks of data to the disk on that machine to see if the disk is bad. The point is that the configuration information is not easily available to me at this particular moment. I can tell you that configuring the sar data collector involves setting up a cron job that runs the sa2 utility about every ten minutes.


All times are GMT -5. The time now is 12:29 PM.