How Do You Monitor The Disk Activity of a Linux Server with a Command Similar to top?

Problem scenario
You think that there is disk contention with the various processes on your Linux server.  You think that the I/O activity is too high and potentially creating a bottleneck.  What do you do to learn more about disk utilization?

1.  To learn the names of the underlying disks on your Linux system, run this command:

ls -lh /dev/disk/by-path

2.  Now run this command:

ls -lh /dev/disk/by-path | awk '{print $11}'

3.  Then based on the output of the above command, mentally replace the "../../" with "/dev/" when you compose the next command.  (So instead of using "../../sda1" use "/dev/sda1".)

To find the activity with five-second intervals of each disk found in the above command, compose a command such as this:

iostat -dz /dev/sda /dev/sda1 /dev/sda2 5

# The arguments between the "-dz" and "5" are the names of the disks.  Run the command you compose in the format above (e.g., with the interval you want and the disks you want).  The "z" flag omits disks that have no activity during the reporting period.

Leave a comment

Your email address will not be published. Required fields are marked *