Skip to content

Latest commit

 

History

History
94 lines (61 loc) · 1.94 KB

File metadata and controls

94 lines (61 loc) · 1.94 KB

Install smartmontools

First, ensure the smartmontools package is installed. Run the appropriate command for your distribution:

Debian/Ubuntu:

sudo apt update
sudo apt install smartmontools

RHEL/CentOS/AlmaLinux/Rocky Linux:

sudo yum install smartmontools

Fedora:

sudo dnf install smartmontools

Step 2: Check SMART Support

Check if your disk supports SMART (Self-Monitoring, Analysis, and Reporting Technology):

sudo smartctl -i /dev/sdX

Replace /dev/sdX with the appropriate disk (e.g., /dev/sda).

Look for a line that says SMART support is: Enabled. If it’s not enabled, you can activate it with:

sudo smartctl -s on /dev/sdX
sudo smartctl --scan | grep bus

Step 3: Perform a Quick Health Check

Run the following command to get an overview of the disk's health:

sudo smartctl -H /dev/sdX

This will return a simple health status (PASSED or FAILED).

Step 4: View Detailed Disk Information

To see detailed SMART attributes and statistics, use:

sudo smartctl -A /dev/sdX
sudo smartctl -a -d megaraid,9 /dev/bus/0

Look for attributes like Reallocated_Sector_Ct, Current_Pending_Sector, and Temperature_Celsius.

Step 5: Perform a Self-Test

To initiate a self-test, you can choose either a short or long test:

  • Short Test (takes a few minutes):
sudo smartctl -t short /dev/sdX
  • Long Test (can take several hours depending on disk size):
sudo smartctl -t long /dev/sdX

You can check the progress or results of the self-test with:

sudo smartctl -l selftest /dev/sdX

Step 6: Monitor SMART Logs

For detailed logs of disk events, use:

sudo smartctl -l error /dev/sdX

Notes:

  • Replace /dev/sdX with the actual device identifier of your disk (e.g., /dev/sda, /dev/nvme0n1).
  • Running SMART commands on disks in a RAID array may require using specific utilities or bypassing the RAID controller.