7/25/2016 - 12:16 PM

LINUX: Troubleshooting DISK usage

LINUX: Troubleshooting DISK usage

Troubleshooting linux DISK usage


iostat -x 1
  • Display only cpu statistics: iostat -c
  • Display only network statistics: iostat -n
  • Display only i/o statistics: iostat -d
  • Display I/O data in MB/second: iostat -m
  • Display I/O statistics only for a device: iostat -p sda


  • Install: sudo apt-get install iotop
  • Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -o, --only            only show processes or threads actually doing I/O
  -b, --batch           non-interactive mode
  -n NUM, --iter=NUM    number of iterations before ending [infinite]
  -d SEC, --delay=SEC   delay between iterations [1 second]
  -p PID, --pid=PID     processes/threads to monitor [all]
  -u USER, --user=USER  users to monitor [all]
  -P, --processes       only show processes, not all threads
  -a, --accumulated     show accumulated I/O instead of bandwidth
  -k, --kilobytes       use kilobytes instead of a human friendly unit
  -t, --time            add a timestamp on each line (implies --batch)
  -q, --quiet           suppress some lines of header (implies --batch)
  • Examples:
iotop --only
iotop -o -d 5
iotop -aoP


dstat -tdD total,sda,sdb,sdc,md1 60


  • Install: sudo apt-get install sysstat
sar collects and displays ALL system activities statistics.
sadc stands for “system activity data collector”. This is the sar backend tool that does the data collection.
sa1 stores system activities in binary data file. sa1 depends on sadc for this purpose. sa1 runs from cron.
sa2 creates daily summary of the collected statistics. sa2 runs from cron.
sadf can generate sar report in CSV, XML, and various other formats. Use this to integrate sar data with other tools.
iostat generates CPU, I/O statistics
mpstat displays CPU statistics.
pidstat reports statistics based on the process id (PID)
nfsiostat displays NFS I/O statistics.
cifsiostat generates CIFS statistics.



watch -n 5 cat /sys/block/sda/stat
watch -n 5 cat /proc/diskstats