← All guides

Check Disk SMART Attributes with smartctl -A

Updated:

Check Disk SMART Attributes with smartctl -A

Monitor disk SMART attributes to track disk health, detect disk failures early, and prevent data loss. This guide shows you how to check SMART attributes and set up automated monitoring.

For comprehensive disk health monitoring, see Disk Health Monitoring with SMART. For troubleshooting disk issues, see Disk Space Full Server.

Why Checking SMART Attributes Matters

SMART attributes provide early warning signs of disk failure. Monitoring SMART attributes enables predictive maintenance, allowing disk replacement before catastrophic failures occur.

Method 1: Check SMART Status with smartctl

Check SMART Health Status

# Install smartmontools
sudo apt-get install smartmontools  # Debian/Ubuntu
sudo yum install smartmontools      # CentOS/RHEL

# Check SMART status
sudo smartctl -H /dev/sda

# Get SMART health summary
sudo smartctl -a /dev/sda

# Check SMART attributes
sudo smartctl -A /dev/sda

Monitor Critical SMART Attributes

# Check reallocated sectors
sudo smartctl -A /dev/sda | grep "Reallocated_Sector_Ct"

# Check pending sectors
sudo smartctl -A /dev/sda | grep "Current_Pending_Sector"

# Check uncorrectable sectors
sudo smartctl -A /dev/sda | grep "Offline_Uncorrectable"

# Check power-on hours
sudo smartctl -A /dev/sda | grep "Power_On_Hours"

Method 2: Run SMART Self-Tests

Execute SMART Tests

# Run short self-test
sudo smartctl -t short /dev/sda

# Run long self-test
sudo smartctl -t long /dev/sda

# Check self-test results
sudo smartctl -l selftest /dev/sda

# Check test progress
sudo smartctl -c /dev/sda

Method 3: Automated SMART Monitoring with Zuzia.app

Manual checks work while you are looking. To keep running them without you, Zuzia uses its agent and scheduled tasks.

How it works in Zuzia

  • Install the Zuzia agent on the server with one command. CPU, RAM, disk, load and network metrics start reporting on their own, with alerts on a threshold, on drift from the server's normal, or on a disk fill-up forecast.
  • Save the commands from this guide as a scheduled task and choose how often it runs, from every minute to once a year. The agent runs it on every host you pick.
  • If a command fails, you get an alert right away by email, Slack, Discord, push (through your Pushover account) or SMS (through your Vonage account).
  • The output of every run is kept, so you can look back at what changed. On paid plans, AI can read the output and alert you only when it spots a problem.

Setting it up

  1. Add the server in the Zuzia dashboard and install the agent.
  2. Create a scheduled task with the check commands below, then choose the hosts and how often it runs.
  3. Choose your notification channels. Turn on maintenance mode during planned work so it doesn't trigger alerts.

Best Practices for SMART Monitoring

1. Monitor Critical SMART Attributes

  • Track reallocated sectors count
  • Monitor pending sector count
  • Check uncorrectable sector count
  • Watch power-on hours

2. Run Regular SMART Self-Tests

  • Schedule short self-tests daily
  • Run long self-tests weekly
  • Review self-test results
  • Act on test failures

3. Track Disk Wear Trends

  • Monitor SMART attributes over time
  • Identify disk degradation patterns
  • Plan disk replacements proactively
  • Document disk replacement schedules

4. Set Up Comprehensive Alerts

  • Configure alerts for critical attributes
  • Set up alerts for SMART test failures
  • Monitor disk temperature
  • Alert on disk health degradation

Troubleshooting Disk Health Issues

Step 1: Identify Disk Problems

When disk health issues are detected:

# Check SMART status
sudo smartctl -H /dev/sda

# Check critical attributes
sudo smartctl -A /dev/sda | grep -E "Reallocated|Pending|Uncorrectable"

# Review SMART test results
sudo smartctl -l selftest /dev/sda

Step 2: Resolve Disk Issues

Based on investigation:

  1. Replace Failing Disks:

    • Replace disks with high reallocated sectors
    • Replace disks with pending sectors
    • Replace disks before catastrophic failure
  2. Optimize Disk Usage:

    • Reduce disk I/O load
    • Optimize disk configuration
    • Implement disk redundancy

FAQ: Common Questions About SMART Monitoring

How often should I check SMART attributes?

For production servers, continuous automated monitoring is essential. Zuzia.app can check SMART attributes every 30-60 minutes, storing historical data and alerting you when disk problems are detected.

What SMART attributes indicate disk failure?

Critical SMART attributes indicating potential disk failure include high reallocated sector count, pending sectors, uncorrectable sectors, and increasing error rates. Monitor these attributes closely.

How do I know when to replace a disk?

Replace disks when SMART attributes indicate degradation, reallocated sectors increase significantly, pending sectors appear, or SMART self-tests fail. Plan replacements proactively before catastrophic failure.

Can SMART monitoring impact disk performance?

SMART monitoring has minimal impact on disk performance when done correctly. Use efficient monitoring tools, schedule checks during low-traffic periods, and avoid excessive SMART self-tests during peak usage.

Related guides, recipes, and problems

  • Related guides

    • guides--monitoring-disk-health-smart-predictive.md
    • guides--monitoring-disk.md
  • Related recipes

    • recipes--check-disk-smart-health-status.md
  • Related problems

    • problems--disk-space-full-server.md
    • problems--high-disk-io-performance-impact.md

We use cookies to ensure the proper functioning of our website.