8 Essential Commands to Troubleshoot Hard Drive Problems on Linux
10:34, 15.04.2026
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 -dnyHere 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.