iostat Command in Linux Explained: Syntax, Options, Cheat Sheet & Practical Examples

Learn how to use the iostat command in Linux with syntax, options, cheat sheet, and practical examples. This guide explains how to monitor CPU utilization, disk I/O performance, device throughput, and storage bottlenecks using iostat for system performance analysis and troubleshooting.

Published

Updated

Read time 16 min read

Reviewed byDeepak Prasad

iostat Command in Linux Explained: Syntax, Options, Cheat Sheet & Practical Examples

The iostat command is widely used by Linux administrators to monitor CPU usage and disk I/O performance. It helps identify disk bottlenecks, analyze system load, and troubleshoot storage performance issues.


Quick iostat Command Cheat Sheet

The iostat command is widely used by Linux administrators to monitor CPU usage and disk I/O performance. It helps identify disk bottlenecks, analyze system load, and troubleshoot storage performance issues.

The following quick reference cheat sheet summarizes the most commonly used iostat commands for monitoring CPU usage, disk activity, and device performance in Linux systems.


Basic iostat Commands

Description Command
Display CPU and disk statistics since system boot iostat
Display statistics continuously every N seconds iostat N
Display statistics N times at M second interval iostat M N
Display iostat version iostat -V
Display help for iostat command iostat -h

CPU Monitoring Commands

Description Command
Display CPU statistics only iostat -c
Monitor CPU usage continuously every 2 seconds iostat -c 2
Display CPU statistics with timestamp iostat -c -t
Display CPU statistics in JSON format iostat -c -o JSON

Disk and Device Monitoring Commands

Description Command
Display disk utilization report only iostat -d
Monitor disk usage continuously iostat -d 2
Display statistics for a specific device iostat sda
Display statistics for multiple devices iostat sda sdb
Monitor disk activity with timestamps iostat -d -t

Extended Disk Statistics

Description Command
Display extended disk statistics iostat -x
Monitor extended disk statistics every 2 seconds iostat -x 2
Display extended statistics for specific disk iostat -x sda
Show extended statistics with timestamp iostat -x -t

Disk Partition Monitoring

Description Command
Display statistics for all partitions iostat -p
Display statistics for specific disk partitions iostat -p sda
Display statistics for all devices and partitions iostat -p ALL

Device Mapper and LVM Monitoring

Description Command
Display registered device mapper names iostat -N
Monitor LVM devices and logical volumes iostat -x -N

Output Formatting Options

Description Command
Display statistics in kilobytes per second iostat -k
Display statistics in megabytes per second iostat -m
Display human readable statistics iostat -h
Display timestamp for each report iostat -t
Reduce output width for narrow terminals iostat -s

Filtering and Display Options

Description Command
Hide devices without activity iostat -z
Display statistics for group of devices iostat -g group_name
Monitor specific devices only iostat sda sdb

Automation and Structured Output

Description Command
Display output in JSON format iostat -o JSON
Export CPU statistics in JSON iostat -c -o JSON
Export extended disk statistics in JSON iostat -x -o JSON

What is iostat in Linux

The iostat command in Linux is a monitoring utility used to report CPU utilization and disk input/output statistics. It helps administrators analyze how storage devices and the CPU are being used by the system.

The command is part of the sysstat package and collects statistics from kernel interfaces such as /proc and /sys. By analyzing these statistics, administrators can detect disk bottlenecks, high I/O wait times, and inefficient storage usage.

What the iostat command does

The iostat command monitors the performance of storage devices and the CPU by displaying statistics related to read and write operations. It measures how busy disks are, how much data is transferred, and how long requests take to complete.

Key tasks performed by iostat include:

  • Reporting CPU usage statistics
  • Displaying disk read/write throughput
  • Showing device utilization
  • Monitoring disk latency and request queues
  • Identifying potential I/O bottlenecks

Why iostat is important for disk performance monitoring

Disk performance issues can significantly impact the performance of applications, databases, and system services. The iostat command helps administrators understand how storage devices behave under load.

Using iostat, you can:

  • Detect slow or overloaded disks
  • Identify high disk latency
  • Monitor I/O wait affecting CPU performance
  • Analyze storage throughput and request rates
  • Troubleshoot performance degradation

Because it provides detailed device-level statistics, iostat is one of the most commonly used tools for Linux storage performance monitoring.

Difference between iostat and other monitoring tools

Several Linux utilities monitor system performance, but each focuses on different areas.

Tool Purpose
iostat Monitors CPU usage and disk I/O statistics
vmstat Displays memory, CPU, and system process statistics
iotop Shows real-time disk I/O usage per process
sar Collects and reports historical system performance data
dstat Combines CPU, disk, network, and memory statistics

While tools like vmstat and dstat provide broader system monitoring, iostat specializes in analyzing disk I/O performance, making it particularly useful when troubleshooting storage-related issues.


Install iostat in Linux

The iostat command is included in the sysstat package on most Linux distributions. If the command is not available on your system, you can install the sysstat package using your distribution's package manager.

Install iostat on RHEL, CentOS, and Rocky Linux

On Red Hat based distributions such as RHEL, CentOS, AlmaLinux, and Rocky Linux, install the sysstat package using the following command:

bash
sudo yum install sysstat

On newer distributions that use dnf, you can install it with:

bash
sudo dnf install sysstat

Install iostat on Ubuntu and Debian

On Debian based systems such as Ubuntu, Debian, and Linux Mint, install the package using:

bash
sudo apt update
sudo apt install sysstat

Verify sysstat package installation

After installation, verify that the iostat command is available by checking its version.

bash
iostat -V

If installed successfully, the command will display the sysstat version and build information.

You can also confirm the binary location using:

bash
which iostat

Enable sysstat service if iostat is not working

Some Linux distributions require enabling the sysstat data collection service for full functionality.

Enable and start the service using:

bash
sudo systemctl enable sysstat
sudo systemctl start sysstat

You can verify the service status with:

bash
sudo systemctl status sysstat

Once enabled, the system will start collecting performance statistics that can be used by tools such as iostat, sar, and mpstat.


Basic Syntax of iostat Command

General iostat command syntax

The basic syntax of the command is:

bash
iostat [options] [interval] [count]

Where:

  • options specify the type of statistics to display
  • interval defines the time between reports in seconds
  • count specifies how many reports should be generated

Running the command without arguments displays statistics since system startup.

bash
iostat

Understanding iostat arguments

The most commonly used arguments include:

Option Description
-c Display CPU utilization statistics only
-d Display disk statistics only
-x Display extended disk statistics
-k Display statistics in kilobytes
-m Display statistics in megabytes
-p Display statistics for partitions
-t Display timestamp for each report

These options help administrators analyze different aspects of system and disk performance.

Running iostat with interval and count

The interval and count parameters allow continuous monitoring of system activity.

For example, to display statistics every 2 seconds, run:

bash
iostat 2

To display five reports at two-second intervals, run:

bash
iostat 2 5

This is useful for observing short-term disk activity and real-time performance changes.


Monitor Disk Performance in Real Time

Display disk statistics every second

To monitor disk activity every one second, run:

bash
iostat 1

This command continuously refreshes disk statistics at one-second intervals, allowing you to observe real-time disk usage.

Monitor disk activity continuously

To monitor disk usage using extended statistics, which provide more detailed metrics such as latency and utilization, use:

bash
iostat -x 2

This displays extended disk statistics every two seconds.

Important metrics to observe include:

  • await – average time for I/O requests
  • svctm – service time for requests
  • %util – percentage of time the device is busy

Capture disk statistics for a fixed duration

Sometimes you may want to monitor disk activity for a specific duration rather than continuously.

For example, to capture 10 reports every 3 seconds, run:

bash
iostat 3 10

This command collects disk statistics for 30 seconds, which is useful for short-term performance analysis or troubleshooting temporary system load.


Monitor CPU Usage Using iostat

Display CPU statistics only

To display only CPU utilization statistics without disk information, use the -c option.

bash
iostat -c

Example output:

text
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          3.21    0.15    1.88    0.30    0.00   94.46

This report shows how the CPU time is distributed across different activities.

Monitor CPU utilization continuously

To monitor CPU usage in real time, specify an interval value.

For example, the following command displays CPU statistics every 2 seconds.

bash
iostat -c 2

This helps identify temporary spikes in CPU usage and understand whether CPU load increases during heavy disk activity.

Interpret CPU utilization fields in iostat

The CPU report includes several important fields:

Field Description
%user CPU time spent running user-level processes
%nice CPU time spent running processes with adjusted priority
%system CPU time spent executing kernel operations
%iowait CPU time spent waiting for disk I/O operations
%steal Time stolen by the hypervisor in virtual environments
%idle Percentage of time CPU remained idle

High %iowait values usually indicate disk performance issues, while high %user or %system values indicate CPU-intensive workloads.


Monitor Disk I/O Activity

Display disk utilization report

To display disk device statistics only, use the -d option.

bash
iostat -d

This command shows statistics for all available disk devices.

Typical output includes:

  • number of transfers per second
  • data read and written
  • cumulative disk activity

Monitor disk reads and writes

To monitor disk activity continuously, run:

bash
iostat -d 2

This displays disk statistics every 2 seconds, allowing administrators to observe real-time read and write operations.

Important columns include:

  • kB_read/s – data read per second
  • kB_wrtn/s – data written per second
  • tps – number of I/O transfers per second

Track disk throughput using iostat

Disk throughput represents the rate at which data is transferred between the disk and system memory.

You can monitor throughput in megabytes per second using:

bash
iostat -m

This command displays disk read and write throughput in MB/s, which makes it easier to interpret high data transfer rates.


Understand iostat Output Fields

Explain tps field in iostat

The tps (transfers per second) field indicates the number of I/O operations issued to the disk per second.

Example:

text
Device    tps   kB_read/s   kB_wrtn/s
sda       25.4     520        180

Higher TPS values indicate more disk activity. However, high TPS combined with high latency may indicate a disk bottleneck.

Understand kB_read/s and kB_wrtn/s

These columns represent the amount of data read from and written to the disk per second.

Field Meaning
kB_read/s Kilobytes read per second
kB_wrtn/s Kilobytes written per second

These values help measure disk throughput and workload intensity.

Understand await, svctm and util

When using extended statistics (-x option), additional fields appear:

Field Meaning
await Average time (milliseconds) for I/O requests to complete
svctm Average service time for I/O requests
%util Percentage of time the device was busy

A high %util value (close to 100%) indicates that the disk is fully utilized.

Identify disk bottlenecks using iostat

Disk bottlenecks can often be identified by analyzing the following metrics:

  • High await values indicate slow disk response time
  • High %util values suggest disk saturation
  • High iowait CPU percentage indicates the CPU is waiting for disk operations

Combining these indicators helps determine whether storage performance is limiting system performance.


Monitor Specific Disk Devices

Monitor statistics for a single disk

To monitor a specific disk device such as sda, run:

bash
iostat sda

This command displays statistics only for the specified disk.

Example:

text
Device    tps   kB_read/s   kB_wrtn/s
sda       12.5     120        80

Monitor disk partitions

To display statistics for a disk and its partitions, use the -p option.

bash
iostat -p sda

Example output:

text
Device    tps   kB_read/s   kB_wrtn/s
sda       14.1     210        95
sda1      13.8     208        95

This helps analyze performance issues related to specific partitions.

Monitor multiple devices together

You can monitor multiple disks simultaneously by specifying multiple device names.

bash
iostat sda sdb

This command displays disk statistics only for the selected devices.


Advanced Disk Monitoring with Extended Statistics

Display extended disk statistics

Run the following command to display detailed disk metrics:

bash
iostat -x

Extended statistics include additional columns such as:

  • r/s – read requests per second
  • w/s – write requests per second
  • await – average wait time
  • %util – disk utilization

Identify slow disks using await

The await value shows the average time taken to complete I/O requests.

Example:

text
Device   await
sda      2.5
sdb     35.7

If the value is consistently high, it indicates disk latency or slow storage devices.

Detect disk saturation using util percentage

The %util field indicates the percentage of time the disk was busy processing I/O requests.

Example:

text
Device   %util
sda      20.3
sdb      98.7

A value close to 100% suggests the disk is fully saturated, which may cause performance degradation.


Monitor Disk Throughput in MB/s or KB/s

Disk throughput indicates the amount of data transferred between the disk and system per second. The iostat command allows you to display this information in different units such as kilobytes or megabytes to make it easier to analyze storage performance.

Display disk statistics in kilobytes

By default, many Linux distributions display disk throughput in kilobytes per second. You can explicitly force this format using the -k option.

bash
iostat -k

Example output:

text
Device    tps   kB_read/s   kB_wrtn/s
sda       18.2      950        320

This format is useful when monitoring low to moderate disk activity where values remain within kilobyte ranges.

Display disk statistics in megabytes

For systems with high throughput workloads such as databases, backups, or storage servers, displaying statistics in megabytes is easier to interpret.

bash
iostat -m

Example output:

text
Device    tps   MB_read/s   MB_wrtn/s
sda       20.1      12.4        4.2

Using megabytes helps simplify interpretation when disk activity involves large data transfers.

Choose appropriate units for monitoring

Choosing the correct unit depends on the workload being analyzed.

Unit Recommended Use
Kilobytes (KB/s) Low disk activity systems
Megabytes (MB/s) High throughput workloads
Extended statistics Detailed performance analysis

Administrators typically use MB/s when analyzing storage performance in servers, databases, and virtualization environments.


Monitor LVM Devices and Device Mapper Statistics

Systems using Logical Volume Manager (LVM) often use device mapper devices such as dm-0, dm-1, etc. These names may not be immediately recognizable. The iostat command provides options to display the mapped device names.

Display device mapper names

To display registered device mapper names instead of generic dm-* device identifiers, use the -N option.

bash
iostat -N

Example output:

text
Device            tps   kB_read/s   kB_wrtn/s
vg_root-lv_root   12.3      220        180
vg_data-lv_data    5.8       95         40

This makes it easier to identify logical volumes associated with specific disks.

Monitor LVM volumes using iostat

To monitor detailed statistics for LVM devices, combine extended statistics with device mapper names.

bash
iostat -x -N

This command displays extended disk metrics along with the logical volume names, helping administrators diagnose performance issues within LVM storage layers.


Generate Structured Output for Automation

Modern monitoring systems and scripts often require structured output formats. The iostat command supports exporting statistics in JSON format, making it easier to integrate with monitoring tools.

Export iostat output in JSON format

To display statistics in JSON format, use the -o JSON option.

bash
iostat -o JSON

Example output:

json
{
  "sysstat": {
    "hosts": [
      {
        "nodename": "server1",
        "statistics": [
          {
            "avg-cpu": {
              "user": 4.12,
              "system": 1.83,
              "iowait": 0.45,
              "idle": 93.60
            }
          }
        ]
      }
    ]
  }
}

JSON output is particularly useful for automation and monitoring systems.

Use JSON output for monitoring scripts

Structured JSON output can be integrated into scripts that monitor system performance.

Example:

bash
iostat -x -o JSON

This allows administrators to build scripts that analyze disk latency, throughput, and utilization automatically.

Parse iostat output using jq

The jq utility can be used to extract specific fields from JSON output.

Example:

bash
iostat -o JSON | jq '.sysstat.hosts[0].statistics[0]'

This makes it easier to process disk statistics programmatically.


Reduce Output Width for Smaller Terminals

In some cases, the default iostat output may exceed the width of the terminal window. The -s option provides a shorter output format that fits within narrow terminals.

Use narrow output mode

To display a compact version of the report, use:

bash
iostat -s

Example output:

text
Device      tps   kB_read/s   kB_w+d/s
sda         15.4      820        240

This reduces column width and simplifies the output layout.

Make iostat output readable in limited terminal width

The narrow format is especially useful when:

  • working in small terminal windows
  • viewing output over SSH sessions
  • displaying results on 80-column terminals

You can combine it with other options as well:

bash
iostat -x -s

This command shows extended statistics in a compact format.


Monitor Disk Partitions

The iostat command can display statistics not only for physical disks but also for individual disk partitions.

Display disk partition statistics

To display partition-level statistics, use the -p option.

bash
iostat -p

Example output:

text
Device    tps   kB_read/s   kB_wrtn/s
sda       15.2      700        220
sda1      10.4      450        180
sda2       4.8      250         40

This shows both the main disk and its partitions.

Monitor all partitions on a device

To display statistics for a specific disk and all its partitions, specify the device name.

bash
iostat -p sda

This helps identify which partition is generating the most disk activity.

Monitor unused partitions

To include statistics for partitions that have not been used during the sampling period, use:

bash
iostat -p ALL

This command ensures all available partitions are listed, even if they currently have no I/O activity.


iostat vs Other Linux Monitoring Tools

Linux provides several monitoring utilities that help administrators analyze system performance. While iostat focuses on disk I/O and CPU statistics, other tools provide insights into memory usage, process-level activity, and historical performance data.

Understanding how these tools differ helps choose the right tool when troubleshooting system performance issues.

iostat vs vmstat

The vmstat command reports information about memory usage, processes, paging activity, and CPU statistics. While iostat focuses primarily on disk I/O performance, vmstat provides a broader view of overall system activity.

Feature iostat vmstat
CPU utilization Yes Yes
Disk I/O statistics Yes Limited
Memory usage No Yes
Process statistics No Yes
System performance overview Partial Comprehensive

Use iostat when analyzing disk performance and storage bottlenecks, and use vmstat when troubleshooting memory pressure or overall system load.

iostat vs iotop

The iotop utility displays real-time disk I/O usage by individual processes, similar to how the top command shows CPU usage.

Feature iostat iotop
Device-level disk statistics Yes No
Process-level disk activity No Yes
Real-time monitoring Yes Yes
Disk throughput analysis Yes Limited

Use iostat to analyze overall disk device performance, and use iotop to identify which processes are generating disk I/O activity.

iostat vs sar

The sar command (System Activity Reporter) is also part of the sysstat package and collects historical system performance statistics.

Feature iostat sar
Real-time disk statistics Yes Yes
Historical performance data No Yes
CPU monitoring Yes Yes
Disk activity trends Limited Detailed

Use iostat when analyzing current disk performance, and use sar when reviewing historical system performance trends over time.

When to use each tool

Each monitoring tool serves a specific purpose depending on the performance issue being investigated.

Tool Best Use Case
iostat Diagnosing disk I/O bottlenecks
vmstat Investigating CPU, memory, and system load
iotop Identifying processes causing heavy disk I/O
sar Analyzing historical performance trends

In practice, administrators often use these tools together to gain a complete understanding of system performance.


Frequently Asked Questions

1. What is iostat used for in Linux?

The iostat command in Linux is used to monitor CPU usage and disk input/output statistics. It helps administrators analyze disk performance, detect storage bottlenecks, and monitor read and write activity on system devices.

2. What does TPS mean in iostat?

TPS in iostat stands for transfers per second. It represents the number of I/O operations issued to a device per second, including both read and write requests.

3. How do I install iostat in Linux?

The iostat command is part of the sysstat package. You can install it using package managers such as sudo apt install sysstat on Ubuntu or sudo yum install sysstat on RHEL, CentOS, and Rocky Linux.

4. What does %util mean in iostat?

The %util field in iostat indicates the percentage of time the disk device was busy processing I/O requests. A value close to 100% suggests that the disk is fully utilized and may be a performance bottleneck.

Summary

The iostat command is a powerful Linux monitoring tool used to analyze CPU utilization and disk I/O performance. It helps administrators identify storage bottlenecks, monitor disk activity, and troubleshoot performance issues in real time.

By using options such as -x, -d, and -p, administrators can obtain detailed statistics about disk devices, partitions, and storage workloads. When combined with other monitoring utilities such as vmstat, iotop, and sar, iostat becomes an essential tool for diagnosing system performance problems and optimizing storage performance.


Official Documentation

For detailed information about the iostat command and all available options, refer to the official documentation.

iostat manual page

Rohan Timalsina

is a technical writer and Linux enthusiast who writes practical guides on Linux commands and system administration. He focuses on simplifying complex topics through clear explanations.