How to check hard drive health on Linux
How to Check Hard Drive Health on Linux (Complete Guide)
Hard drives fail. It’s not a question of if — it’s a question of when. Whether you’re running a well-loved desktop, a busy workstation, or a humble home server, every spinning platter and solid-state chip has a finite lifespan. Knowing how to linux check disk health before a drive reaches its breaking point is one of the most valuable maintenance habits you can build. A few minutes of monitoring today could save you hours of data recovery headaches tomorrow.
The good news is that Linux gives you professional-grade diagnostic tools completely free of charge. You don’t need expensive software or a computer science degree — just the right commands and a basic understanding of what the output means. In this guide, we’ll walk you through two proven methods: smartctl for command-line power users, and GNOME Disks for those who prefer a graphical interface. By the end, you’ll know exactly how to assess your drive’s condition, run diagnostic tests, and decide when it’s time to back up your data and plan for a replacement.
Both methods rely on a technology called S.M.A.R.T. — Self-Monitoring, Analysis, and Reporting Technology — which is built into virtually every modern hard drive and SSD. Think of it like your car’s check-engine light, except far more detailed. Let’s start by understanding what S.M.A.R.T. actually tells you.
Understanding S.M.A.R.T. Technology
S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) is a monitoring system built directly into hard drives and SSDs at the firmware level. It continuously tracks dozens of internal metrics — from how many times the drive has been powered on, to the number of sectors that have developed read errors. When something starts going wrong inside your drive, S.M.A.R.T. is usually the first to know.
What S.M.A.R.T. Tracks
Each S.M.A.R.T. attribute represents a specific aspect of drive health. The most important ones to watch include:
- Reallocated Sector Count — The number of bad sectors the drive has mapped out and replaced with spare sectors. Any value above zero deserves attention; a rising count is a serious warning sign.
- Current Pending Sector Count — Sectors that are unstable and waiting to be reallocated. This means the drive has found areas it can’t reliably read, which is a strong indicator of developing failure.
- Uncorrectable Sector Count — Sectors that couldn’t be corrected even with error recovery. Non-zero values here are critical.
- Temperature — Drive operating temperature in Celsius. Most HDDs operate safely between 0–60°C; SSDs tolerate a wider range. Sustained high temperatures dramatically shorten drive life.
- Power-On Hours — Total lifetime hours the drive has been running. This provides useful context — a 50,000-hour drive is statistically far more likely to fail than a 5,000-hour one.
- Spin Retry Count (HDDs) — How many times the drive motor had to retry spinning up. Elevated values can indicate mechanical problems.
How Reliable Are S.M.A.R.T. Predictions?
S.M.A.R.T. is genuinely useful, but it’s not infallible. Research from Backblaze — a cloud storage company that monitors hundreds of thousands of drives — has shown that while S.M.A.R.T. errors reliably predict imminent failure in many cases, a significant portion of drives fail without any prior S.M.A.R.T. warnings at all. The takeaway: a clean S.M.A.R.T. report is reassuring, but it’s not a guarantee. Always maintain regular backups regardless of what S.M.A.R.T. says.
Does Your Drive Support S.M.A.R.T.?
Virtually all drives manufactured after 2000 support S.M.A.R.T. The quickest way to confirm is to check the label on the drive itself or the product documentation. You can also verify programmatically once smartmontools is installed — the tool will tell you immediately if S.M.A.R.T. is unavailable or disabled on a particular device. NVMe drives use a slightly different attribute structure, but smartctl handles them well with the --device=nvme flag or by simply pointing it at the NVMe device path (e.g., /dev/nvme0).
Method 1: Check Disk Health on Linux Using smartctl (Command Line)
The smartctl command is part of the smartmontools package and is the gold standard for drive health diagnostics on Linux. It works over SSH, integrates easily into scripts and cron jobs, and provides the most detailed output of any tool available. If you want complete control over your disk health monitoring, this is the method to master.
Installing smartmontools
Open a terminal and run the command that matches your Linux distribution:
Ubuntu:
sudo apt install smartmontools
Debian:
sudo apt-get install smartmontools
Arch Linux:
sudo pacman -S smartmontools
Fedora:
sudo dnf install smartmontools
openSUSE:
sudo zypper install smartmontools
Generic Linux: Search for “smartmontools” in your distribution’s package manager. Because it’s one of the most widely used drive diagnostic tools in the Linux ecosystem, it’s available in virtually every distribution’s repositories. If you need to build from source, the official package is available at smartmontools.org.
Once installed, verify it’s working by running:
smartctl --version
You should see version information printed to the terminal, confirming the installation succeeded.
Step 1 — Identify Your Drives with lsblk
Before you can check a drive, you need to know its device label. Run the following command to list all storage devices attached to your system:
lsblk
This prints a tree view of your block devices. Look for entries like /dev/sda, /dev/sdb, or /dev/nvme0n1. The base device label (e.g., sda) refers to the whole drive, while numbered suffixes (e.g., sda1, sda2) refer to individual partitions. You want the drive label, not the partition label, for health checks.
Step 2 — Run a Basic Health Assessment
The quickest way to get a pass/fail verdict on a drive is with the -H flag:
sudo smartctl -H /dev/sda
Replace sda with your actual drive label. The output will include a line reading either PASSED or FAILED. A PASSED result means the drive’s overall S.M.A.R.T. assessment is healthy. A FAILED result means the drive has crossed a critical threshold and you should treat it as a serious warning — back up your data immediately.
Step 3 — View Complete S.M.A.R.T. Data
For a full picture of your drive’s health, use the -a flag to print all available S.M.A.R.T. information:
sudo smartctl -a /dev/sda
This output is comprehensive. You’ll see the drive’s model, serial number, firmware version, capacity, and a full table of S.M.A.R.T. attributes. Each attribute has a VALUE, a WORST (the lowest the value has ever been), and a THRESH (the threshold below which the drive is considered failing). If any attribute’s VALUE drops below its THRESH, that attribute has failed.
Step 4 — Interpret the Key Attributes
Scanning through a full S.M.A.R.T. report can feel overwhelming at first. Focus on these critical attributes:
- Reallocated_Sector_Ct (ID 5) — Should be 0 on a healthy drive. Any non-zero value means the drive has found and mapped out bad sectors. A value of 1–5 warrants increased monitoring; anything higher is a strong warning to back up and plan replacement.
- Current_Pending_Sector (ID 197) — Sectors awaiting reallocation. Non-zero values indicate the drive is struggling to read certain areas. This often precedes reallocated sector increases.
- Offline_Uncorrectable (ID 198) — Sectors that failed during offline testing and couldn’t be corrected. Non-zero values here are serious.
- Temperature_Celsius (ID 194) — Check that your drive is operating within its rated temperature range. Sustained temperatures above 50°C for HDDs can accelerate wear significantly.
- Power_On_Hours (ID 9) — Divide by 8,760 to get approximate years of operation. A drive with 40,000+ hours is statistically entering higher-risk territory.
For SSDs, pay particular attention to Wear_Leveling_Count and Total_LBAs_Written, which indicate how much of the drive’s write endurance has been consumed. NVMe drives expose similar data through the nvme-cli tool, though smartctl also reads basic NVMe health data.
Running Diagnostic Tests with smartctl
Beyond reading S.M.A.R.T. data, smartctl can instruct the drive to run its own internal self-tests. There are three test types to know:
- Short test — Takes 1–2 minutes. Tests the most critical drive components. Good for quick routine checks.
- Long test — Can take several hours depending on drive size. Performs a full surface scan. Use this for thorough periodic testing or when investigating suspected problems. Avoid running this on a drive you already suspect is failing without first backing up your data.
- Conveyance test — Designed for drives that have just been shipped or moved. Tests for transport damage. Only available on some drives.
To start a short test:
sudo smartctl -t short /dev/sda
To start a long test:
sudo smartctl -t long /dev/sda
The drive will run the test in the background. To check the results once it’s complete:
sudo smartctl -a /dev/sda
Scroll to the “SMART Self-test log” section of the output. Each completed test will show a status of either Completed without error or a specific error description. A failed test result — especially on a long test — is a strong indicator that the drive needs attention.
Saving a Drive Health Report
For documentation, monitoring baselines, or sharing with support, you can export the full smartctl report to a text file:
sudo smartctl -a /dev/sda >> /home/username/Documents/drive-report.txt
This appends the report to the file, preserving previous entries if you run it multiple times. It’s a good habit to save a baseline report when a drive is new, so you have a reference point for comparison later.
To automate monthly health checks, you can add a cron job. Run sudo crontab -e and add a line like this to check every first day of the month at 2 AM:
0 2 1 * * /usr/sbin/smartctl -a /dev/sda >> /home/username/Documents/smart-log.txt
Method 2: Check Hard Drive Health on Linux Using GNOME Disks (GUI)
If you’d rather not work in the terminal, GNOME Disks provides a clean graphical interface for checking drive health, viewing S.M.A.R.T. data, and running self-tests. It’s pre-installed on most GNOME-based distributions (including Ubuntu and Fedora Workstation) and offers a surprisingly capable set of diagnostic features.
Installing GNOME Disks
If GNOME Disks isn’t already on your system, install it with the appropriate command for your distribution:
Ubuntu:
sudo apt install gnome-disk-utility
Debian:
sudo apt-get install gnome-disk-utility
Arch Linux:
sudo pacman -S gnome-disk-utility
Fedora:
sudo dnf install gnome-disk-utility
openSUSE:
sudo zypper install gnome-disk-utility
Once installed, open it from your application menu by searching for Disks. On non-GNOME desktops it runs perfectly well as a standalone application. If your distribution doesn’t carry it in the repositories, the source code is available on GNOME’s GitLab.
Viewing Disk Health at a Glance
When GNOME Disks launches, it automatically selects the first detected storage device — usually your primary system drive. The left panel lists all connected drives; click any drive to select it and view its details on the right.
Look at the Assessment field in the drive information panel. This gives you an instant summary of the drive’s S.M.A.R.T. status — typically showing either a healthy status or flagging specific concerns. For many users doing a routine check, this summary is all they need.
Accessing the Full S.M.A.R.T. Dashboard
For a complete breakdown of all S.M.A.R.T. attributes, press Ctrl + S while a drive is selected, or click the menu button (three vertical dots) and choose S.M.A.R.T. Data & Self-Tests.
The S.M.A.R.T. dashboard presents all attributes in a clean table with human-readable names. The top of the panel shows an overall assessment — a healthy drive will show a positive status, while a drive with critical attribute failures will display a warning. Scroll through the attribute list and look for any rows flagged in a warning colour, or any attributes where the current value is close to or below the threshold.
Running Self-Tests in GNOME Disks
To run a diagnostic test, open the S.M.A.R.T. dashboard and click the Start Self-test button. You’ll be prompted to choose between a Short test (a few minutes) and an Extended test (potentially several hours for large drives). For routine monthly checks, the short test is sufficient. If you’re investigating a suspected problem or haven’t tested the drive in a long time, run the extended test — but make sure your data is backed up first.
GNOME Disks shows test progress in real time and displays the result when complete. A clean result confirms no surface errors were found during the test. Any errors reported should be treated seriously.
GUI vs. CLI — Which Should You Use?
Both methods are equally valid; the right choice depends on your situation:
- Use smartctl when you need detailed output, are working over SSH on a remote machine, want to automate checks with scripts or cron jobs, or need to run tests on headless servers.
- Use GNOME Disks when you want a quick visual health check on a desktop machine, prefer a graphical interface, or are performing a one-off check without needing to save or script the output.
Interpreting Results and Taking Action
Getting the data is only half the job — knowing what to do with it is what actually protects your files. Here’s how to respond to different scenarios.
Green Light: Your Drive Is Healthy
If your S.M.A.R.T. overall assessment shows PASSED, all critical attributes are at zero, and your self-tests complete without errors, your drive is in good shape. This is the outcome you want to see. Even so, establish a monitoring schedule:
- Typical desktop users: Run a short self-test monthly and a long test every 3–6 months.
- Critical systems (servers, NAS, primary work machines): Consider weekly short tests and monthly long tests.
- New drives: Run a conveyance test immediately after installation to check for shipping damage, then save a baseline report for future comparison.
Yellow Light: Warning Signs Are Present
If you see non-zero values for Reallocated Sector Count, Current Pending Sector Count, or Uncorrectable Sector Count — even small ones — treat this as a meaningful warning. The drive is not necessarily about to fail this minute, but it’s telling you something is wrong. Your action plan:
- Back up all important data to an external drive or cloud storage immediately.
- Increase your monitoring frequency — check weekly rather than monthly.
- Start budgeting for a replacement drive. Don’t wait for total failure.
- Avoid running long tests on a drive showing these symptoms without first securing a full backup.
Red Light: Imminent Failure
If smartctl reports a FAILED overall health status, or if critical attributes have crossed their thresholds, treat this as an emergency. The drive could become unreadable at any moment. Stop using it for new writes where possible and focus entirely on data recovery:
- Back up everything you can right now, prioritising the most important files first.
- If the drive is already struggling to respond, consider professional data recovery services before the situation deteriorates further.
- Replace the drive as soon as your data is secured. Do not continue relying on a drive that has failed its S.M.A.R.T. assessment.
Creating a Realistic Monitoring Schedule
Disk health monitoring only works if you actually do it. Build it into a routine you’ll stick to:
- Monthly: Run
sudo smartctl -H /dev/sdaon all drives for a quick pass/fail check. - Every 3 months: Run a full
smartctl -areport and compare against your baseline. Look for any attributes that are trending worse over time, even if they haven’t crossed a threshold yet. - Every 6 months: Run a long self-test on drives that hold critical data.
- When something feels off: Unusual noises, slow performance, or file system errors are all reasons to run an immediate full check.
Best Practices for Long-Term Linux Disk Health Monitoring
Checking your drive health is most effective when combined with good maintenance habits. Here are the practices that make the biggest difference:
- Keep drives cool: Heat is one of the leading causes of premature drive failure. Ensure good airflow in your case, keep ambient temperatures reasonable, and consider additional cooling if your drives regularly run above 45°C. For laptops, keep vents clear and use on hard flat surfaces.
- Never ignore early warnings: The most common mistake users make is noticing a non-zero reallocated sector count and deciding to “keep an eye on it” without actually backing up. When S.M.A.R.T. flags a problem, act immediately.
- Maintain backups regardless of health status: S.M.A.R.T. cannot predict all failures. Drives can fail suddenly without warning. The 3-2-1 backup rule — three copies of your data, on two different media types, with one stored off-site — is the only real protection against data loss.
- Document baseline values for new drives: Save a
smartctl -areport when a drive is brand new. This gives you a reference point to detect gradual degradation over time. - Factor in drive age: Drives older than 5 years carry statistically higher failure risk regardless of their current S.M.A.R.T. status. Backblaze data consistently shows failure rates increasing significantly after this point. Treat aging drives with appropriate caution.
- Understand SSD differences: SSDs fail differently from HDDs. They don’t have reallocated sectors in the same way, but they do have finite write endurance. Monitor the Wear Leveling Count and Total Bytes Written attributes on SSDs. When a flash cell wears out, SSDs typically enter a read-only mode rather than failing catastrophically — but you still need to replace them promptly.
- Consider automated monitoring with smartd: The smartmontools package includes a daemon called smartd that can monitor drives continuously in the background and email you if it detects problems. Configure it in
/etc/smartd.conffor hands-free monitoring on important systems.
Conclusion
Checking your hard drive health on Linux is genuinely straightforward once you know the tools. With smartctl, you get precise, scriptable diagnostics that work on any Linux system — from a Raspberry Pi to a production server. With GNOME Disks, you get a clean visual dashboard that makes S.M.A.R.T. data accessible to anyone, no terminal required. Both methods read the same underlying data; choose whichever fits your workflow.
The most important takeaway isn’t the specific commands — it’s the habit. Running a quick smartctl -H check once a month takes about ten seconds and could give you the early warning you need to save irreplaceable files. Combine regular linux disk health monitoring with a solid backup strategy, and you’ve built a genuinely resilient system that can weather the inevitable hardware failures that come with time.
If you found this guide useful, explore our related Linux maintenance and data protection guides to build out a complete system reliability routine. Your future self — the one who didn’t lose their data — will thank you.
Typo on this page. Search for smartlctl and you’ll find it.
It is an excellent writing, I recommend it.
Thanks derrik, that was very useful.
Hi,
Your article was very helpful.
Let Me know how can i check the Health of HDD or SATA drive.
Shall i use the smartctl tool?
Thanks,
Mohd Habeeb Ur Rehman