Monitor Disk I/O activity using IOTOP & IOSTAT commands

If your Linux box gets slow down, automatically our fingers types top command in terminal to check server load. If you don’t get any proper solution from top command output, then you can have a look into wa status because most of the time our server gets slow down due to heavy I/O Read and Write on hard disk. If its high, it could be a chance. So, we need to check I/O activity on hard drive. We can monitory I/O activity in linux box using iotop and iostat commands. Alternatively you Monitor system resources using HTop, SAR commands.

1) How to install iotop

Use the below command to install iotop in linux system. To install iotop to RHEL/Centos/Scientific Linux, probably you need to enable EPL or REPOFORGE or REMI repository because there is no official package on this.

# Install iotop on Ubuntu/Debian/LinuxMint #
$ sudo apt-get install iotop

# Install iotop on RHEL/Centos/SL/Fedora 21 & older systems #
# yum install iotop

# Install iotop on Fedora 22 & later systems #
# dnf install iotop

# Install iotop on openSUSE #
# zypper install iotop

2) Monitor disk I/O on individual process

Use the iotop command to monitor disk I/O on individual process. This tool output smiler to top command. see the below screen shot of iotop output without any argument.

$ iotop

monitoring-disk-io-in-linux-1
Use the iotop command with o option to print actual I/O activity.

$ iotop -o

monitoring-disk-io-in-linux-2

3) How to install iostat

Use the below command to install iostat in linux system. You have to install sysstat because iostat is part of sysstat package.

# Install iostat in Ubuntu/Debian/LinuxMint #
$ sudo apt-get install sysstat

# Install iostat on RHEL/Centos/SL/Fedora 21 & older systems #
# yum install sysstat

# Install iostat on Fedora 22 & later systems #
# dnf install sysstat

# Install iostat on openSUSE #
# zypper install sysstat

To print individual hard disk I/O activity, use the iostat command with below option. It will print the output 5 second interval

$ iostat -dx 5

# Options #
d : Display the Disk utilization
x : Display extended statistics
5 : Interval in seconds

monitoring-disk-io-in-linux-3
To print individual partition of hard disk I/O activity, use the iostat command with below option.

$ iostat -dpx 5

# Option #
p : displays statistics of all partition

monitoring-disk-io-in-linux-4
Keep on EYE with 2g to get latest linux tips….)

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

Shares
Close
Please support the site
By clicking any of these buttons you help our site to get better