Raspberry Pi

Get Raspberry Pi Device Input and Output Statistics Using iostat

The iostat is a Linux command to find the storage input/output statistics for a device and partitions. It monitors the average load on the CPU at the device’s active time and provides users the information about I/O average transfer rates.

For Raspberry Pi users, this command is helpful if someone wants to change the system configuration as it generates a report that can better balance the I/O load on the system’s file disk, volumes, and adapters.

This article will show you how to view the input and output statistics on Raspberry Pi using the iostat command.

Shows Raspberry Pi Device Input and Output Statistics Using iostat

By default, the iostat command isn’t installed on the Raspberry Pi system. The Raspberry Pi users can use the “iostat” command by installing the “sysstat” package on the system through the following command:

$ sudo apt install sysstat -y

After the installation, the users can run the command “iostat” to get the I/O information on Raspberry Pi terminal.

The above command outputs the results related to the system’s logical and physical I/O devices.

The above command outputs can be summarized as follows:

%user: CPU utilization percentage at the user level.

%nice: CPU utilization percentage at the user level with a nice priority.

%system: CPU utilization percentage at the system (kernel) level.

%steal: CPU utilization percentage during the time spent in involuntary wait by the virtual CPU or CPUs while another virtual processor services the hypervisor.

%idle: CPU utilization percentage in the ideal mode.

The device/partition names are written in green color, while the other information includes transferring rate (tps), reading rate (number of blocks), and writing rate (number of blocks) followed by the total amount of blocks read and written after that.

If the users are only interested in getting the CPU information, they can apply the following command:

$ iostat -c

If the users want to get the device port information, they can use the following command:

$ iostat -d

To see the iostat information of only the main system storage, you can use the following command to get the result in kilobytes.

$ iostat -k

Similar information in megabytes can be drawn using the following command:

$ iostat -m

For further help, you can open the iostat manual using the following command:

$ man iostat

Conclusion

iostat is a useful Linux command that displays the input and output statistics on the Raspberry Pi terminal. The above guidelines show how to use this command by installing the “sysstat” package on the Raspberry Pi system through the “apt” command. Afterward, different iostat commands are executed in the terminal to get the I/O statistics on the Raspberry Pi device.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.