8 Essential Commands to Troubleshoot Hard Drive Problems on Linux

watch 4m, 59s
views 2

10:34, 15.04.2026

Article Content
arrow

  • Understanding Hard Drive Bottlenecks
  • Methods to Identify Disk Bottlenecks in Linux
  • Using iostat for Input/Output Statistics
  • Monitoring in Real-Time with iotop
  • Checking Disk Usage with df Command
  • Comprehensive Resource Analysis with dstat
  • Analyzing System Activity with sar
  • Utilizing smartctl for Disk Health Monitoring
  • Listing Block Devices with lsblk
  • Tracking Virtual Memory and Disk Activity with vmstat
  • Final Thoughts

Thanks to our huge experience with server management, we fully understand how important it is to detect and deal with some of the hard drive problems early on. In case, you immediately react to some issues with the hard drive, the Linux system will function more smoothly.

The issues might occur because of some limitations in the components. For instance, hard drives with slow disk functioning can lead to huge issues with the entire system and specifically influence the functioning of the databases and apps.

That’s why, we decided to share essential commands that can help with troubleshooting hard drive issues.

Understanding Hard Drive Bottlenecks

The bottlenecks with the hard drive can be detected when the disk is not working with the expected speed to match the demands of the system. Such issues can lead to lag, and slower response time, and in some situations, the system crash can even happen.

Here are a couple of factors that can lead to the bottlenecks:

  • Fragmentation of the disk. Slower performance and some problems with disk usage might be caused by the fragmentation of files.
  • Overload of the disk. In situations when there are too many requests, the system might not cope with all of them immediately.
  • Errors. One more problem that might cause serious consequences is the physical issues with hard drives (for instance, bad sectors).
  • Limitations of the hardware. Disks that have small capacities or just old ones cannot cope with the everyday workload.

Methods to Identify Disk Bottlenecks in Linux

To find and deal with those issues, Linux users can try a couple of commands that we will discuss below.

Using iostat for Input/Output Statistics

The first important command that should be used for troubleshooting is iostat. This tool helps to identify the issue by giving statistical data on the usage of I/O and CPU. Here is how to use this command:

iostat -x 1

Once used, you will see an output with lots of metrics and you should specifically pay attention to:

  • await: this information indicates the time needed for the I/O request to finish. It is usually shown in milliseconds and in case the values are high – it shows slower performance characteristics.
  • %util: this data specifies the business of the disks while dealing with requests. In case the number is 80 percent or higher, this means the issue is in the disk.
  • svctm: this information specifies the service time needed for I/O requests. The higher it is, the longer it takes to make a response.

Monitoring in Real-Time with iotop

Real-time I/O monitoring is needed for the detection of the activity/process that consumes too much of the bandwidth, the process looks like this:

sudo iotop

The output of this command will include the processes and their write/read statistical information. The data that you should pay attention to is the following:

  • IO Priority: by detecting these statistics, you can determine which processes use too much of the resources and you can also adjust the necessary priority with ionice.
  • Write/Read: here you can find those processes that have higher write/read values.

Checking Disk Usage with df Command

One more helpful command for checking disk usage on mounted filesystems is df. In the scenarios when the disk is almost full, you can get a serious slowdown.

df -h

Once, you get an output, you should check the info about the home and root (/) directories. They should not be full. In case the disk space is used on more than 85 percent, you can notice some slowdowns.

Comprehensive Resource Analysis with dstat

dstat is one more helpful command that is used for the checking of the system resources. Monitoring the comprehensive resources in real time can be extremely helpful.

 dstat -dny

Here are important parameters to pay attention to:

  • await: this metric shows the time needed for I/O operations to complete.
  • write/read: check the spikes in this kind of activity.  

Analyzing System Activity with sar

To analyze the system from the historical perspective, there is one great option. Sar command can help with collecting and saving information during a prolonged time frame.

sar -d 1 5

In the output, you should pay attention to the following parameters:

  • kB_wrtn/s and kB_read/s: in case the numbers are very high, that might indicate an issue.
  • tps: this metric specifies the number of transactions per sec and in case it has a high value, you should also pay closer attention to this fact.  

Utilizing smartctl for Disk Health Monitoring

This command is helpful for the determination of physical troubles with the disk. For instance such as issues with components or bad sectors.

sudo apt install smartmontools
sudo smartctl -a /dev/sda

The parameters that you should pay attention to are as follows:

  • Seek_Error_Rate: in case of physical damage, the value of this parameter can be significantly high.
  • Reallocated_Sector_Ct: the high value in this category might suggest that there are troubles with the disk.

Listing Block Devices with lsblk

By using this command, you will get access to the list of all block devices so you will get a clearer picture of your storage devices.

lsblk -o NAME,SIZE,ROTA,TYPE,MOUNTPOINT

Here you should check whether partitions/hard drives aren’t overloaded with tasks.

Tracking Virtual Memory and Disk Activity with vmstat

vmstat is great for displaying the usage of memory and I/O operations.

 vmstat 1

In the output pay attention to the following parameters:

  • bo: this specifies the number of blocks written to the disk.
  • si and so: in case of the high values, you can understand that the system is swapping. It may occur due to disk usage or insufficient RAM.
  • bi: this specifies the number of reading blocks.  

Final Thoughts

For diagnosing major issues that can occur with the hard drive, you can use the essential commands on the Linux system. The monitoring of the system should be done regularly even if there are no issues or noticeable problems just to optimize the performance.

Share

Was this article helpful to you?

VPS popular offers

-15.6%

CPU
CPU
2 Xeon Cores
RAM
RAM
512 MB
Space
Space
10 GB SSD
Bandwidth
Bandwidth
1 TB
KVM-SSD 512 Metered Linux

5.33 /mo

/mo

Billed annually

-15.6%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
20 GB SSD
Bandwidth
Bandwidth
30 Mbps
DDoS Protected SSD-KVM 1024 Linux

38 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
400 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 16384 Linux

50 /mo

/mo

Billed annually

-22.2%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
50 GB SSD
Bandwidth
Bandwidth
300 GB
KVM-SSD 4096 HK Linux

33 /mo

/mo

Billed annually

-10%

CPU
CPU
3 Epyc Cores
RAM
RAM
2 GB
Space
Space
20 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 2048 Linux

8.87 /mo

/mo

Billed annually

-9.3%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
150 GB SSD
Bandwidth
Bandwidth
Unlimited
wKVM-SSD 16384 Windows

53.99 /mo

/mo

Billed annually

-5.3%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
60 GB HDD
Bandwidth
Bandwidth
300 Gb
wKVM-HDD HK 2048 Windows

11.48 /mo

/mo

Billed annually

-15%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
80 Mbps
DDoS Protected SSD-wKVM 8192 Windows

101 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
60 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 2048 Linux

7.7 /mo

/mo

Billed annually

-21.5%

CPU
CPU
2 Xeon Cores
RAM
RAM
2 GB
Space
Space
75 GB SSD
Bandwidth
Bandwidth
300 GB
wKVM-SSD 2048 HK Windows

26 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.