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: iotop -oPa shows which program wrote the most to the disk

Disk
~/tips/tip-disk-iotop-opa-top-writers

sudo iotop -oPa

Lists the processes currently reading or writing the disk, with accumulated totals.

iostat tells me the disk is busy, and iotop tells me who is doing it.

sudo iotop -oPa

-o lists only processes that do I/O right now, -P shows processes instead of threads, and -a makes the totals accumulate since iotop started, so a short burst does not vanish from view. Sort by the write column with the arrow keys. It needs root and the iotop package (install it with apt). Add -b for plain output you can send to a file. Compare the totals with iostat to see whether one process explains the whole load.

Further reading: iotop manual page (Debian)

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