As normal users, you may not know clearly about the activities of your disk. Yet, there are ways to help measure the disk activity easily. Now, I’m going to introduce some commands used frequently in Linux to measure the disk activity.

While you are working or studying on the computer, your disk is always active. To know better about the disk activity, you’ll need tools. Here, I’d like to introduce an easy way to help users monitor disk activity easily: using commands for measuring disk activity.

Tips on Measuring Disk Activity in Linux

A series of commands are contained in the Linux systems to help people see:

  • How full the disks are
  • How busy the disks are

measure disk activity

In the following content, I’ll provide 5 of the most useful Linux commands for helping you to look into the disk activity. Now, let’s take a look at them one by one in order to gain specific information about your hard disks.

Please note:

dstat

The “dstat” command offers stats on a lot more than just the disk activity. By using it, you’ll get the valuable insights into the overall performance of Linux system. This command is flexible & powerful and it combines the features, so it replaces the older tools, such as:

  • Vmstat
  • Netstat
  • Iostat
  • Ifstat

However, you may as make use of the “-d” option if you’d like to view only the disk activity. After running the “$ dstat -d” command, a continuous list of disk read/write measurements will appear and the process won’t stop until you type “^c” to end it.

Please note the following things:

  1. After the first report, each subsequent row will be shown in the display to report disk activity after a certain time interval (the default value is one second).
  2. You can set the time interval by adding a number after the -d option.
  3. There are different units for the reported data: M (megabytes), k (kilobytes), and B (bytes).

ioping

Two main functions of the “ioping” command are:

  1. It can report disk latency (how long it will be before a disk start to respond to the requests).
  2. It is able to diagnose disk problems.

This post tells how to recover data from a hard drive with problems:

[Fix] Hard Disk Failure Recovery - How To Recover Your Data
[Fix] Hard Disk Failure Recovery - How To Recover Your Data

As far as I know, hard disk failure recovery is urgent. You have to rescue data in time before they disappear forever.

Read More

atop

By resorting to the “atop” command, you’ll get a series of information about the system performance; of course, some stats on disk activity are included. Yet, there is a way to help you look at just the disk stats: manage it with a “$ atop | grep DSK” command.

iotop

The “iotop” command is actually used for looking at disk I/O. By using it, you can see clearly which processes are most demanding in terms of disk I/O; this is done since the command collects I/O usage information provided by the Linux kernel.

iostat

The “iostat” command is able to monitor the system input and output device loading. How does it monitor disk activity? Actually, it observes the devices’ active time, which is relative to the average transfer rates. Sometimes, this command is used to assess the activity balance among different disks.

“-p” option:

You need to realize that the display will be messed up by all the stats shown on the Linux loop devices if you just would like to focus on your disks. What are you expected to do? Actually, you need to get help from the “-p” option to take a look at your disks only.

Please note that the “tps” is short for transfers per second.

“-d” option:

If you’d like to get repeated reports by using iostat command, you should add a “-d” option to get measurements after a certain time interval.

“-y” option:

Adding the “-y” option to the end of the iostat command can help you leave out the first (stats since boot) report.

Verdict

All in all, enough commands have been provided by Linux for measuring disk activity.

  • The commands help you get an in-depth understanding of how hard your disks are working.
  • They are also able to focus your attention on potential problems or slowdowns.
  • linkedin
  • reddit