7 minute read.Last Modified 2021-07-30 09:07 EDT
S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) is an industry standard for disk monitoring and testing. Disks can be monitored for problems using several different kinds of self-tests. TrueNAS can adjust when and how alerts for S.M.A.R.T. are issued. When S.M.A.R.T. monitoring reports an issue, we recommend you replace that disk. Most modern ATA, IDE, and SCSI-3 hard drives support S.M.A.R.T. Refer to your respective drive documentation for confirmation.
S.M.A.R.T. tests are run on a disk. Running tests can reduce drive performance, so we recommend scheduling tests when the system is in a low-usage state. Avoid scheduling disk-intensive tests at the same time! For example, S.M.A.R.T. tests should not be scheduled on the same day as a disk scrub or resilver.
Go to Storage > Disks and click chevron_right to expand an entry. Enable S.M.A.R.T. shows as true or false.
To enable or disable testing, click EDIT DISK(S) and find the Enable S.M.A.R.T. option.
To quickly test a disk for errors, go to Storage > Disks and select the disks to be tested. After selecting the desired disks, click MANUAL TEST.
Next, select the test Type. Each test type can be slightly different based on the drive connection, ATA or SCSI:
- Long - runs SMART Extended Self Test. This will scan the entire disk surface and can take many hours on large-volume disks.
- Short - runs SMART Short Self Test (usually under ten minutes). These are basic disk tests that vary by manufacturer.
- Conveyance - runs a SMART Conveyance Self Test. This self-test routine is intended to identify damage incurred during transporting of the device. This self-test routine requires only minutes to complete.
- Offline - runs SMART Immediate Offline Test. The effects of this test are visible only in that it updates the SMART Attribute values, and if the test finds errors, they appear in the SMART error log.
- Long - runs the “Background long” self-test.
- Short - runs the “Background short” self-test.
- Offline - runs the default self test in foreground. No entry is placed in the self test log.
For more information, refer to smartctl(8).
Click START to begin the test. Depending on the test type you choose, the test can take some time to complete. TrueNAS generates alerts when tests discover issues.
smartctland the name of the drive:
smartctl -l selftest /dev/ada0.
To schedule recurring S.M.A.R.T. tests, go to Tasks > S.M.A.R.T. Tests and click ADD.
|All Disks||Setting All Disks includes every disk that has S.M.A.R.T. enabled in this test. Leave unset to choose which Disks to test.|
|Disks||Select the disks to monitor.|
|Type||Choose the test type. See smartctl(8) for descriptions of each type. Some types degrade performance or take disks offline.|
|Description||Enter any information about this S.M.A.R.T. test.|
|Schedule||The time when the test runs. Choose a preset or select Custom to open the advanced scheduler.|
Choose the Disks to test, Type of test to run, and Schedule for the task.
SMART tests can offline disks! Avoid scheduling S.M.A.R.T. tests simultaneously with scrub or resilver operations.
When the test must run on a very specific Schedule, set this to Custom to open the advanced scheduler.
Choosing a preset fills in the rest of the fields.
To customize a schedule, enter crontab values for the
These fields accept standard cron values. The simplest option is to enter a single number in the field. The task runs when the time value matches that number. For example, entering 10 means that the job runs when the time is ten minutes past the hour.
An asterisk (
*) means “match all values”.
Specific time ranges are set by entering hyphenated number values. For example, entering 30-35 in the Minutes field sets the task to run at minutes 30, 31, 32, 33, 34, and 35.
Lists of values can also be entered.
Enter individual values separated by a comma (
For example, entering 1,14 in the Hours field means the task runs at 1:00 AM (0100) and 2:00 PM (1400).
A slash (
/) designates a step value.
For example, while entering
* in Days means the task runs every day of the month,
*/2 means the task runs every other day.
Combining all the above examples together creates a schedule running a task each minute from 1:30-1:35 AM and 2:30-2:35 PM every other day.
There is an option to select which Months the task runs. Leaving each month unset is the same as selecting every month.
The Days of Week schedules the task to run on specific days. This is in addition to any listed Days. For example, entering 1 in Days and setting Wed for Days of Week creates a schedule that starts a task on the first day of the month and every Wednesday of the month.
The Schedule Preview shows when the current settings mean the task runs.
|*||Every item.||* (minutes) = every minute of the hour.|
* (days) = every day.
|*/N||Every Nth item.||*/15 (minutes) = every 15th minute of the hour (every quarter hour).|
*/3 (days) = every 3rd day.
*/3 (months) = every 3rd month.
|Comma and hyphen/dash||Each stated item (comma)|
Each item in a range (hyphen/dash).
|1,31 (minutes) = on the 1st and 31st minute of the hour.|
1-3,31 (minutes) = on the 1st to 3rd minutes inclusive, and the 31st minute, of the hour.
mon-fri (days) = every Monday to Friday inclusive (every weekday).
mar,jun,sep,dec (months) = every March, June, September, December.
Days can be specified as days of month, or days of week.
With these options, flexible schedules can be created similar to these examples:
|Desired schedule||Values to enter|
|3 times a day (at midnight, 08:00 and 16:00)||months=*; days=*; hours=0/8 or 0,8,16; minutes=0|
(Meaning: every day of every month, when hours=0/8/16 and minutes=0)
|Every Monday, Wednesday and Friday, at 8.30 pm||months=*; days=mon,wed,fri; hours=20; minutes=30|
|1st and 15th day of the month, during October to June, at 00:01 am||months=oct-dec,jan-jun; days=1,15; hours=0; minutes=1|
|Every 15 minutes during the working week, which is 8am - 7pm (08:00 - 19:00) Monday to Friday||Note that this requires two tasks to achieve:|
(1) months=*; days=mon-fri; hours=8-18; minutes=*/15
(2) months=*; days=mon-fri; hours=19; minutes=0
We need the second scheduled item, to execute at 19:00, otherwise we would stop at 18:45. Another workaround would be to stop at 18:45 or 19:45 rather than 19:00.
Saved schedules appear in the Tasks > S.M.A.R.T. Tests list.
smartd -q showtests.
The S.M.A.R.T. service must be enabled for automatic S.M.A.R.T. tests to run.
To start the S.M.A.R.T. service, go to Services and toggle S.M.A.R.T.. To start the service during the TrueNAS boot process, set Start Automatically.
Configure the S.M.A.R.T. service by clicking edit.
|Check Interval||Define a number of minutes for smartd to wake up and check if any tests are configured to run.|
|Power Mode||Tests are only performed when Never is selected.|
|Difference||Enter a number of degrees in Celsius. SMART reports if the temperature of a drive has changed by N degrees Celsius since the last report.|
|Informational||Enter a threshold temperature in Celsius. SMART will message with a log level of LOG_INFO if the temperature is higher than the threshold.|
|Critical||Enter a threshold temperature in Celsius. SMART will message with a log level of LOG_CRIT and send an email if the temperature is higher than the threshold.|
Don’t forget to click SAVE after changing any settings.