Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

S.M.A.R.T. Accessibility from http interface

Featured Replies

Considering some of the recent threads and the popularity of messages pertaining to drives failing.

It may be wise to add smartctl to the distribution and have the http interface be able to display the full S.M.A.R.T. logs to the user.

By clicking on the Serial number/model number of the drive on the front panel. you could do a smartctl -a /dev/sda (or whatever) and display it to the user.

 

It's easy enough to create a script to do daily, weekly or monthly tests on all of the drives.

However, front end access to the recent data will help users determine if a drive is going to be a problem or not.

In addition, buttons could be added to trigger one of the many S.M.A.R.T. tests on demand.

 

I might suggest just installing the SMARTD daemon itself, however I think that may tend to keep the drives spun up with it's testing.

I'm not sure how it all works.

 

Thoughts?

 

root@unraid:/var/log# smartctl -a /dev/sda 
-bash: smartctl: command not found
root@unraid:/var/log# /boot/custom/bin/smartctl -a /dev/sda 
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model:     Hitachi HTS722020K9SA00
Serial Number:    071007DP0400DTG101HA
Firmware Version: DC4OC54P
User Capacity:    200,049,647,616 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Not recognized. Minor revision code: 0x42
Local Time is:    Sat Feb 23 12:09:30 2008 GMT+5
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:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
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:                 ( 645) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No 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:        (  73) minutes.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   062    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   040    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0007   181   181   033    Pre-fail  Always       -       1
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       27
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   040    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       149
10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       27
191 G-Sense_Error_Rate      0x000a   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       4
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       760
194 Temperature_Celsius     0x0002   203   203   000    Old_age   Always       -       27 (Lifetime Min/Max 19/32)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0
223 Load_Retry_Count        0x000a   100   100   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%       148         -
# 2  Short captive       Interrupted (host reset)      80%       148         -
# 3  Short offline       Completed without error       00%       147         -

SMART Selective self-test log data structure revision number 1
SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

 

 

 

 

Re: Full SMART status of drives

« Reply #2 on: May 10, 2007, 11:54:45 AM »

 

Copy the file 'smartctl' (a program) from the download directory to the root of your Flash.  Then from a telnet session, type:

 

  /boot/smartctl  -a  -d  ata  /dev/sda

 

Look at the Devices page for the device identifer (within the parentheses) for each disk and substitute that for 'sda' on the command line.

 

This command will print out the SMART info for the drive.  We'll try to get this command into the 4.1 release.

 

I found the above from Tom, edited, among my old notes, and Tom put a smartctl.zip on the unRAID download page.  It was apparently removed some time later, but it still works fine.  It appears to be version 5.36, a later version might be better.  For others, it is attached below.  Unzip it to the flash, and follow the instructions above.

 

Your idea is good, useful, has been requested in the past.  I'd like to see a 'Get SMART report' option also save the report with a filename consisting of the disk serial number (not the disk number) and a timestamp, and be placed in a SMART logs folder of the flash.  If one was automatically generated the first time unRAID initialized a drive, then there would be a baseline for later comparison.

 

Great idea - WeeboTech.  Might be nice to include the # of remapped sectors in a column on the main page.  That would be a good stat to monitor, and if a user noticed that number increasing on a drive, (s)he'd know to it might be time to start shopping for another drive).

 

Thanks for posting, RobJ.  I just installed it and it works great.  I was surprised at the info the drive keeps about itself.  If ever a person were to buy a used drive (which I don't recommend), this would be a great report to look at .  Tells how many hours the drive has been powered up, most recent 5 errors that the drive, remapped sector count, times powered on, CRC errors, and a bunch of other stats.  I wondered if the drive might keep some stats to user against a warranty claim - like the highest temperature that ithas even been operated at - but I did not see anyting like that.  Very interesting and highly recommended!

  • Author

I noticed on my newer version of smartctl and new drives, there is history of highest and lowest temperature.

 

194 Temperature_Celsius     0x0002   196   196   000    Old_age   Always       -       28 (Lifetime Min/Max 19/32)

 

Also, the smart report has saved me in the past when I purchased used drives.

I was able to tell the seller immediately the drive was bad and even though he formatted it, the drives own diagnostics are reporting bad sectors.

 

Note to all, Any number in Pending Sectors to be remapped is a bad sign.

It means sectors that have been unreadable and cannnot be remapped for some reason.

 

In the meantime I'm working on a script to run from cron.weekly that will grab the smart reports.

 

Robj, you gave me the idea of saving them to the Flash drive, so that's what I'll do.

 

Probably to flash /var/log/smartctl.sdxx.txt (as a dos file so they can be viewed with note pad).

 

I have version 5.37 (Which is the latest from sourceforge).

 

 

Attached is my first version of a quick smartcheck with logging (only for -a option)

add do your crons if desired.

 

 

 

  • Author

I'd like to see a 'Get SMART report' option also save the report with a filename consisting of the disk serial number (not the disk number) and a timestamp, and be placed in a SMART logs folder of the flash.

 

I'll work on something like this in the future, I posted what I have available now.

 

Great info!  Thanks!

 

Note to all, Any number in Pending Sectors to be remapped is a bad sign.

It means sectors that have been unreadable and cannnot be remapped for some reason.

 

I was wondering if these "pending" sectors are just sectors that have had read error, but have not been subsequently written to.  (Only the write causes a sector to be remapped).  Unless you are running unRAID or routinely running a hard disk maintenance program that reads and writes each sector, these would crop up over time.

  • Author

I was wondering if these "pending" sectors are just sectors that have had read error, but have not been subsequently written to.  (Only the write causes a sector to be remapped).

 

Yes, exactly.

If you happen to run a smartctl -t short or -t long  on a drive, these will usually cause an error in the test.

I did find a procedure on the net that let you calculate the file associated with the LBA# from the smart log.

Thereafter you could copy the file then use dd if=/dev/zero of=badfile count=xxxx to wrte zeros to the sector.

 

Spinrite is a cleaner approach.

Badblocks in non destructive write mode also works. Although I would be sure to have a backup first.

 

 

This is excellent! Thanks guys.

 

Just ran a smartctl on my drives, and one of my older 200GB drives has quite a number of errors on it. Luckily I just ordered a 1TB drive.

The 200GB can come out when the 1TB goes in!

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.