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? |
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.
|
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 / Code:
ps fx Code:
ps --width 132 fx |
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.
|
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. |