Checking Disk Health Like a Pro in Linux

 

Disk problems are one of the most common causes of system instability in Linux. A computer may suddenly become slow, freeze randomly, fail to boot correctly, or start showing file corruption issues. In many cases, the storage device is the real problem.

The good news is that Linux includes powerful tools that let you check disk health directly from the terminal.

This guide walks through the beginner-friendly way to:

  • Identify your disks

  • Check SMART health status

  • Run disk self-tests

  • Read important warning signs

  • Troubleshoot common issues

Everything here is practical, simple, and useful in real-world IT environments.


Understanding Disk Health in Linux

Before checking disk health, it helps to understand what Linux considers a “disk.”

A disk can be:

  • A traditional hard drive (HDD)

  • A solid-state drive (SSD)

  • An NVMe SSD in newer systems

Linux refers to these devices using names like:

  • /dev/sda

  • /dev/sdb

  • /dev/nvme0n1

The easiest way to view disks connected to your system is with:

lsblk

Example output:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS sda      8:0    0   1.8T  0 disk ├─sda1   8:1    0     1G  0 part /boot └─sda2   8:2    0   1.8T  0 part / sdb      8:16   0   500G  0 disk

The lsblk command means “list block devices.”

The physical drives are:

  • sda

  • sdb

The entries underneath them are partitions.

In most Linux systems:

  • sda is often the primary drive

  • NVMe drives usually appear as nvme0n1

In real IT environments, identifying the correct disk is usually the first troubleshooting step before checking health data.


Installing SMART Monitoring Tools

Linux uses SMART technology to monitor drive health.

SMART stands for:

Self-Monitoring, Analysis, and Reporting Technology

Most modern drives support SMART automatically.

To install the monitoring tools on Ubuntu or Debian:

sudo apt update 
sudo apt install smartmontools -y

On Fedora:

sudo dnf install smartmontools -y

Example output:

Setting up smartmontools... 
Created symlink /etc/systemd/system/multi-user.target.wants/smartd.service

The most important command you’ll use is:

smartctl

This command communicates directly with the drive and retrieves health information.


Running a Basic Disk Health Check

The fastest way to check a drive’s overall health is:

sudo smartctl -H /dev/sda

Example output:

SMART overall-health self-assessment test result: PASSED

The -H option means “health.”

This tells Linux to ask the drive for its basic health assessment.

If the result says:

PASSED

the drive has not detected a major failure.

If it says:

FAILED

the drive may be close to failure and should be investigated immediately.

It is important to understand that “PASSED” does not mean the drive is perfect. It only means the drive has not detected a critical failure yet.


Viewing Detailed SMART Information

For deeper information about the drive, use:

sudo smartctl -a /dev/sda

Example output:

Power_On_Hours          15234 
Reallocated_Sector_Ct 0
Temperature_Celsius 34
Current_Pending_Sector 0

As a beginner, focus on a few important values rather than trying to understand everything at once.


Reallocated Sector Count

Reallocated sectors are damaged areas of the drive that have been replaced automatically.

A few may not immediately mean failure, but if the number keeps increasing over time, the drive may be getting worse.


Current Pending Sector

This is one of the most important SMART values.

Pending sectors are areas the drive is struggling to read correctly.

If this number is not zero, it can be a warning sign that the drive is developing problems.


Temperature

High temperatures reduce drive lifespan.

Most drives run comfortably around:

  • 30°C to 45°C

Consistently high temperatures may indicate airflow or cooling problems.


Power On Hours

This shows how long the drive has been powered on during its lifetime.

Older drives naturally have a higher chance of failure compared to newer ones.

In many IT environments, administrators monitor these values regularly to catch failing drives before users lose data.


Running a SMART Self-Test

SMART can run built-in tests directly on the drive.

To start a short self-test:

sudo smartctl -t short /dev/sda

Example output:

Please wait 2 minutes for test to complete.

This test runs in the background while the drive checks itself for problems internally.


Viewing Self-Test Results

After the test completes, view the results with:

sudo smartctl -a /dev/sda

Example output:

SMART Self-test log structure 
Num Test_Description Status
1 Short offline Completed without error

If the test reports:

  • read failures

  • errors

  • incomplete tests

the drive may be starting to fail.

SMART testing is commonly used before:

  • replacing hardware

  • migrating systems

  • troubleshooting unexplained slowness


Checking NVMe SSD Health

Newer systems often use NVMe drives instead of traditional SATA drives.

These drives use different device names.

Example:

nvme0n1

You can identify them with:

lsblk

Example output:

nvme0n1    259:0    0   1T  0 disk 
├─nvme0n1p1
└─nvme0n1p2

To check NVMe health:

sudo smartctl -a /dev/nvme0n1

Example output:

Temperature:                        39 Celsius 
Percentage Used: 8%
Media and Data Integrity Errors: 0

One important value is:

Percentage Used

This estimates how much of the drive’s expected lifespan has already been consumed.

NVMe monitoring is especially important in laptops and modern servers where these drives are heavily used for performance.


Checking System Logs for Disk Errors

Sometimes Linux detects storage problems before users notice them.

To search for errors in system logs:

sudo dmesg | grep -i error

Example output:

ata1: failed command 
I/O error on device sda

This command searches kernel logs for lines containing the word “error.”

Repeated disk-related errors are usually worth investigating further.

In production systems, administrators often combine SMART checks with system log analysis to diagnose unstable machines.


Disk Usage vs Disk Health

A full disk and a failing disk are different problems.

Many beginners confuse the two.

To check disk usage:

df -h

Example output:

Filesystem      Size  Used Avail Use% 
/dev/sda2 1.8T 1.6T 150G 92%

This command shows:

  • total space

  • used space

  • remaining space

A healthy drive can still cause problems if it becomes completely full.

For example, Linux servers often become unstable when log files consume all available storage space.


Common Beginner Mistakes

Forgetting sudo

Example error:

smartctl open device: Permission denied

SMART commands usually require administrator permissions.

If you forget sudo, Linux may block access to the hardware.


Using the Wrong Disk Name

Always verify the correct device first:

lsblk

Common examples include:

/dev/sda 
/dev/sdb
/dev/nvme0n1

Running commands against the wrong drive can create confusion.


SMART Not Supported

Example output:

SMART support is: Unavailable

Some USB adapters and virtual machines do not fully support SMART monitoring.

That does not automatically mean the drive is bad.


Real-World Troubleshooting Example

Imagine a user reports:

  • freezing

  • slow performance

  • files opening slowly

A practical troubleshooting process might look like this:

First identify the drive:

lsblk

Then check the basic health:

sudo smartctl -H /dev/sda

Then review detailed SMART data:

sudo smartctl -a /dev/sda

Example finding:

Current_Pending_Sector  12

This indicates the drive is struggling to read certain areas correctly.

At this point, an administrator would typically:

  • back up important data

  • monitor the system closely

  • prepare to replace the drive

This is why disk health monitoring matters. It helps catch problems before complete failure happens.


Final Thoughts

Checking disk health is one of the most valuable Linux troubleshooting skills you can learn early.

The process is straightforward once you break it into small steps:

  1. Identify the disk

  2. Install SMART tools

  3. Check basic health

  4. Review detailed SMART data

  5. Run self-tests

  6. Watch for system errors

Work through these commands a few times and they will start to feel natural.

Over time, these checks become part of normal Linux system maintenance and troubleshooting.