iostat is one of the many useful sysstat tools available on Linux that print out reports and statistics about the system. This tool in particular gives detailed stats about storage devices and partitions. It also provides some brief stats about the CPU.
$ sudo apt install sysstat
$ iostat
Linux 5.4.0-1028-raspi (joe-rpi) 02/15/21 _aarch64_ (4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
2.29 0.01 3.65 9.72 0.00 84.32
Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd
dm-0 0.07 0.01 25.60 0.00 3317 14197808 0
loop0 0.00 0.00 0.00 0.00 970 0 0
loop1 0.00 0.00 0.00 0.00 954 0 0
mmcblk0 0.45 7.44 4.72 436.97 4128807 2619145 242335269
sda 28.69 0.02 855.15 0.00 11137 474249512 0
$ iostat -c
$ iostat -d
$ iostat -p
$ iostat -dp
$ iostat 2
You need to use Ctrl+C
to exit.
$ iostat 2 5
$ iostat -y 2
Note that iostat -y
will not give you the current stats report. It will just behave like iostat
and print the cumulative stats-since-boot.
Tried with: sysstat 12.2.0 and Ubuntu 20.04