iostat Command in Linux (original) (raw)

Last Updated : 21 Apr, 2026

The iostat command in Linux is used to monitor CPU usage and input/output (I/O) statistics for devices and partitions. It helps administrators understand how storage devices are performing and whether the system is experiencing disk bottlenecks.

**Note: The iostat command is part of the sysstat package. If it is not installed on your system, you'll need to install it first.

Installing iostat (sysstat package)

1. On Red Hat / CentOS / Fedora:

**Command:

sudo yum install sysstat

2. On Debian / Ubuntu / Linux Mint:

sudo apt-get install sysstat

Example: Displaying Basic CPU and Device Statistics

**Command:

iostat

**Output:

iostate

1. CPU Report (avg-cpu Section)

The avg-cpu section gives us an overview of CPU utilization:

2. Device Utilization Report

The device section provides information about I/O operations for each disk device:

Syntax

iostat [options] [device_name] [interval] [count]

**Note: If interval and count are not specified, iostat displays a single report.

Options of iostat Command

1. -h, --help

Displays the help message and exits. This option provides usage syntax and a list of available options.

**Syntax:

iostat --help

**Output:

iostate-help

2. -x: Extended Statistics

Displays detailed (extended) I/O statistics for devices. This option provides deeper insight into disk performance and is useful for troubleshooting and performance analysis.

**Syntax:

iostat -x

**Output:

**Example: -xd: Extended Statistics for Devices Only

When -x is combined with -d, the command shows extended statistics for devices only (excluding CPU statistics).

**Command:

iostat -xd

**Output:

3. -c: CPU Statistics Only

Displays only CPU statistics. Provides CPU utilization metrics, including %user, %system, %idle, etc..

**Syntax:

iostat -c

**Output:

4. -d: Device Statistics Only

Displays only device (disk) statistics without CPU information.

**Syntax:

iostat -d

**Output:

5. -k: Kilobytes

Displays statistics in kilobytes per second instead of the default block units.

**Syntax:

iostat -k

**Output:

6. -m: Megabytes

Displays statistics in megabytes per second, making the output easier to read for high-throughput systems.

**Syntax:

iostat -m

**Output:

7. -j: Persistent Device Names

Displays statistics using persistent device names instead of standard /dev/sdX names. This is useful when device names change after reboot.

**Syntax:

iostat -j ID mmcbkl0 sda6 -x -m 2 2

**Example:

8. -p: Partitions

Displays statistics for block devices and all their partitions automatically. If a specific device is provided, it shows statistics for that device and its partitions.

**Syntax:

iostat -p

**Output:

9. -N: LVM / Device Mapper Names

Displays registered device-mapper names (such as LVM logical volumes) instead of underlying physical device names.

**Syntax:

iostat -N

**Output:

Using Interval and Count

You can monitor statistics at regular intervals by specifying

**Syntax:

iostat [options] interval count

Example 1: Display statistics every 2 seconds, 3 times

This command displays CPU and device statistics in kilobytes every 2 seconds and generates 3 reports.

**Command:

iostat -k 2 3

**Output:

Example 2: CPU statistics only, 2-second interval, 2 reports

This command shows only CPU utilization statistics every 2 seconds and stops after 2 reports.

**Command:

iostat -c 2 2

**Output:

Example 3: Specific devices with interval

To show sda6 and sda7 device only report with 2 seconds interval and 2 times reports.

**Command:

iostat -d sda7 sda6 2 2

**Output: