In this tutorial, we will show you how to install iostat on Ubuntu 22.04 LTS. For those of you who didn’t know, iostat is a command-line utility that is used to report input/output statistics for block devices and partitions on Linux systems. It is useful for monitoring disk utilization, identifying performance bottlenecks, and tracking disk usage over time. By default, iostat displays a summary of I/O usage since the last reboot. It also provides real-time updates on the current CPU usage and disk performance. The command can be run with various options to customize the output or generate historical data.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the iostat on Ubuntu 22.04. You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
- A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for iostat.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install Iostat on Ubuntu 22.04 LTS Jammy Jellyfish
Step 1. First, make sure that all your system packages are up-to-date by running the following
apt commands in the terminal.
sudo apt update sudo apt upgrade sudo apt install wget apt-transport-https gnupg2 software-properties-common
Step 2. Installing Iostat on Ubuntu 22.04.
By default, iostat is available on Ubuntu 22.04 base repository. Now run the following command below to install the latest stable version of Iostat to your Ubuntu systems:
sudo apt install sysstat
After the installation is complete, you can verify that iostat is installed by running the following command:
Step 3. Iostat Basic Example.
Now that you’ve installed iostat on your Ubuntu 22.04 system, you can use it to monitor your system’s disk I/O. The basic syntax for the iostat command is:
iostat [options] [interval] [count]
Here is an explanation of the different parts of the command:
options: Additional parameters that modify the behavior of the iostat command. These are explained in more detail below.
interval: The length of time (in seconds) between each report. The default value is 1 second.
count: The number of reports that iostat will generate before exiting. If the count is omitted, iostat will run indefinitely until it is interrupted.
Here are some of the most commonly used options for the iostat command:
|Display CPU utilization statistics.|
|Display disk utilization statistics.|
|Display statistics in kilobytes per second instead of the default of sectors per second.|
|Display statistics in megabytes per second instead of the default of sectors per second.|
|Include a timestamp in each report.|
|Display extended statistics. This option provides additional information on disk utilization, including average queue length, service time, and wait time.|
Here are a few examples of how to use the iostat command:
- To display CPU utilization statistics:
- To display disk utilization statistics:
- To display extended disk utilization statistics:
- To display disk utilization statistics in kilobytes per second:
- To display two reports, each 10 seconds apart:
iostat 10 2
Congratulations! You have successfully installed iostat. Thanks for using this tutorial for installing the iostat on the Ubuntu system. For additional help or useful information, we recommend you check the official Iostat website.