brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: iostat -xz 1 shows how busy each disk is, once per second

Disk
~/tips/tip-disk-iostat-xz-busy-disks

iostat -xz 1

Prints per-disk utilisation and wait times every second to show whether storage is the bottleneck.

When a server feels slow I check whether the disk is the bottleneck before I blame the CPU.

sudo apt install sysstat
iostat -xz 1

-x adds the extended columns such as r_await, w_await and %util, and -z leaves out devices that did nothing. A device near 100% %util with a growing await time is saturated. The first report is an average since boot, so read the second one onward. On NVMe drives %util says less, because they handle many requests in parallel.

Further reading: iostat manual page

More Disk tips sudo e2freefrag /dev/sdb1 sudo smartctl -a --json /dev/sda | jq '.smart_status.passed' lsscsi -s udisksctl power-off -b /dev/sdX du -sh — .[!.]* * 2>/dev/null | sort -h All Disk tips (44) All topics

Link