NavigationContentFooter
Jump toSuggest an edit
Was this page helpful?

Diagnosis of a failing disk

Reviewed on 06 February 2025Published on 02 November 2021

Smartmontools is a set of tools that controls and monitors a disk using the SMART standard (Self-Monitoring, Analysis, and Reporting Technology System).

It consists of two parts:

  • smartd, a daemon that allows you to periodically check your hard drives
  • smartctl, a command line tool to view the status of the hard disk

The tool supports the vast majority of modern hard drives.

Before you startLink to this anchor

To complete the actions presented below, you must have:

  • A Dedibox account logged into the console
  • A Dedibox dedicated server

How to check a server with no RAID controllerLink to this anchor

  1. Log into your server using SSH.
  2. Run the following command from the root account (or precede it with sudo):
    smartctl -a /dev/sdx
    Note

    The identifier sdx refers to your hard disk. Make sure that you replace x with a, b , c, etc. depending on the disk you want to test.

How to check a Dell multi-disk serverLink to this anchor

Dell PERC H200 controllerLink to this anchor

On these servers, the physical disks are referred to as sg* devices.

  1. Log into your server using SSH.

  2. Run the following commands:

    smartctl -a -T permissive /dev/sg0
    smartctl -a -T permissive /dev/sg1
    smartctl -a -T permissive /dev/sg2
    Tip

    As the devices can be positioned a little further away, do not hesitate to test up to sg5 if you do not have conclusive results.

Dell PERC controller (H310, H700, H710, H730-P, LSI9361)Link to this anchor

Two possibilities exist for this type of controller:

  • megaclisas-status and
  • megacli

The first one displays the status of the RAID volume, whilst the second one displays the SMART status of the disks.

  1. Log into your server using SSH.
  2. Update the APT package lists cache, and install the required packages:
    apt update
    apt install megaclisas-status megacli
  3. Run the following command to display the status of the RAID volume:
    megaclisas-status
  4. Run the following little script to retrieve the SMART values of your disks:
    DEVICE=/dev/sda
    for i in $(megacli -pdlist -a0 | grep Id | cut -d":" -f2); do
    echo "============================== $i =============================="
    smartctl -s on -a -d megaraid,${i} ${DEVICE} -T permissive
    done

How to check an HP multi-disk server (P410, P420, P222)Link to this anchor

  1. Log into your server using SSH.
  2. Run the following command to display the status of the RAID:
    ssacli ctrl all show config
    An output similar to the following example displays:
    Smart Array P410 in Slot 1 (sn: PACCRID111003N3)
    array A (SATA, Unused Space: 0 MB)
    logicaldrive 1 (1.8 TB, RAID 1, OK)
    physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SATA, 2 TB, OK)
    physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SATA, 2 TB, OK)
  3. Run the following command to display the SMART values of the disks:
    smartctl -a -d cciss,0 /dev/sg0
    then run:
    smartctl -a -d cciss,1 /dev/sg0

How to use SMARTD to monitor your disksLink to this anchor

smartd allows you to monitor your disks and to be alerted (depending on the configuration) by email in case of failure.

Important

There is no guarantee as to the result of SMARTD and the time remaining before the disk fails completely. However, we strongly encourage you to back up and request a replacement rapidly.

How to configure SMARTDLink to this anchor

Below, you will find an example of a single-disk server installed on a Debian-like machine.

Note

The following commands are to be executed as root or via sudo.

  1. Log into your server using SSH.
  2. Enable basic SMART options:
    smartctl -s on -o on -S on /dev/sda
  3. Check that the disk is healthy:
    smartctl -H /dev/sda
  4. Edit the file /etc/smartd.conf, to set up automated tests:
    • Start by commenting out the following line:

      DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
    • Then add a line similar to the following example:

      /dev/sda -a -d sat -o on -S on -s (S/../.././01|L/../1/03) -m root -M exec /usr/share/smartmontools/smartd-runner

The example above allows you to test your hard disk as follows:

  • A short test (S) every day at 1am (01)
  • A long test (L), every Monday (1) at 3am (03)
  1. Activate the daemon by uncommenting the line start_smartd=yes in the file /etc/default/smartmontools.
  2. Start the daemon by running the following command:
    service smartmontools start

If a problem is detected, it will send a default mail to root (-m root). You can redirect the mails sent to the root user to your personal mailbox or send this mail directly to another address.

How to run tests manuallyLink to this anchor

To run SMART tests manually, use the following commands:

  • smartctl -t short /dev/sda to run a short test on your disk
  • smartctl -t long /dev/sda to run a long test on your disk

Once the tests are completed, you can check the results with the following command:

smartctl -l selftest /dev/sda

How to report disk failuresLink to this anchor

If you notice any errors when running a SMART diagnosis on your disk, open a support ticket and ask for the disk to be replaced, indicating the serial number with the result of the smartctl command:

=== START OF INFORMATION SECTION ===
Device Model: SAMSUNG HD103UJ
Serial Number: S13PJ1KQ513170 <----------------------- Serial Number
Firmware Version: 1AA01113
User Capacity: 1 000 204 886 016 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 3b
Local Time is: Fri Oct 29 11:20:27 2010 CEST
Tip

For more information on Smartmontools, refer to the official documentation.

The example below shows SMART data for the HDD storage type:

=== START OF INFORMATION SECTION ===
Model Family: Seagate Constellation ES.3
Device Model: ST1000NM0033-9ZM173
Serial Number: Z1W2P3WL
LU WWN Device Id: 5 000c50 0790721c5
Add. Product Id: DELL(tm)
Firmware Version: GA0A
User Capacity: 1 000 204 886 016 bytes [1,00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.0, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Jan 22 11:26:49 2025 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 90) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 115) minutes.
Conveyance self-test routine
recommended polling time: ( 3) minutes.
SCT capabilities: (0x50bd) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x010f 079 063 044 Pre-fail Always - 90441339
3 Spin_Up_Time 0x0103 096 095 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 26
5 Reallocated_Sector_Ct 0x0133 100 100 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 093 060 030 Pre-fail Always - 2198492836
9 Power_On_Hours 0x0032 094 011 000 Old_age Always - 5442
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 18
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 1
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 071 061 045 Old_age Always - 29 (Min/Max 27/34)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 9
193 Load_Cycle_Count 0x0032 094 094 000 Old_age Always - 12859
194 Temperature_Celsius 0x0022 029 040 000 Old_age Always - 29 (0 22 0 0 0)
195 Hardware_ECC_Recovered 0x001a 046 015 000 Old_age Always - 90441339
196 Reallocated_Event_Count 0x0032 000 000 000 Old_age Always - 65535
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 62209 (42 197 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 75618145300
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 528734761477
SMART Error Log Version: 1
No Errors Logged

If total_uncorrected_errors or errors_corrected_by_rereads_rewrites is > 0, the disk is out of order.

Note

If you encounter Health status: Failed or Failing Now, the disk is considered out of order. Make sure that you have backups, then open a support ticket and ask for the disk to be replaced, indicating the serial number with the result of the smartctl command.

Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway