Skip to content

smartmontools package

negan07 edited this page May 2, 2021 · 32 revisions

opkg update && opkg install smartmontools

Dependencies: ancistrus-core, hdparm, hd-idle

Binaries included: smartctl, smartd

Config files: /usr/etc/smartd.conf

Database: smart_drivedb.h

GUI section: Storage

Usage: rc_smontools < start restart startforced restartforced umount kumount stop mount remount kmount init reconfig info updatedb > (<debug>)

Nvram variables:

smartd_enable = 0|1 (0)

hdidle_timeout = <0-999> (30)

Docs:

https://www.smartmontools.org/

Hdd storage reliability & Health Test

With this package it's possible to test the hdd storage devices connected through the 2 router's usb 3.0 ports.

As default, the devices are named /dev/sd[a-h] .

Smartd

If enabled it is run post rc usb_service execution.

To enable service type:

nvram set smartd_enable=1

Then restart daemon typing:

rc smontools start

To disable service type:

nvram set smartd_enable=0

rc smontools stop

(GUI Tick/Untick: Turn S.M.A.R.T. Daemon On then Click: Apply).

Man page: https://www.smartmontools.org/browser/trunk/smartmontools/smartd.8.in

Device Idle Timeout

Change all the devices standby timeout in minutes typing:

nvram set hdidle_timeout=<0-999>

rc usb_service reconfig

(GUI Enter the Device Idle Timeout value then Click: Apply).

Note that not all the usb devices can be parked down in sleep mode.

To put storage devices into always on mode, set timeout value to 0 .

smartd.conf

The config file includes many settings: for a further knowledge read the man page tutorial .

Config file is located & stored in /usr/etc/smartd.conf .

To make modifications, vi /usr/etc/smartd.conf then save it and reload ssh with: rc_smontools start .

GUI Click: Modify S.M.A.R.T. Daemon Configuration , edit text then Click: Save then Click: Apply .

The config file won't be saved after package removal/upgrade and after firmware upgrade too.

Update Devices Database

Devices database is located & stored in /usr/etc/drivedb.h .

Type: rc_smontools updatedb to renew/regenerate the device database (GUI Click: Update Database).

Smartctl

Show health infos about storage devices like exercise temperature, hours of usage, damaged blocks, and more.

Man page: https://www.smartmontools.org/browser/trunk/smartmontools/smartctl.8.in

Select Device

GUI: select the Device to Analize (/dev/sd[a-h]).

Note that the only connected storage devices are listed.

Show Device Infos

List of some common info commands.

smartctl -? - help usage.

smartctl -a /dev/sd[a-h] - show S.M.A.R.T. data.

smartctl -x /dev/sd[a-h] - show device data.

smartctl -i /dev/sd[a-h] - show device ID info.

smartctl -H /dev/sd[a-h] - health status.

smartctl -g aam /dev/sd[a-h] - AAM status.

smartctl -g apm /dev/sd[a-h] - APM status.

GUI: Select device to test then select an option then Click Show Info .

AAM Status

Automatic Acoustic Management: reduce the noise emission (and performance) of a mass storage device.

Some infos about values: https://crystalmark.info/en/software/crystaldiskinfo/crystaldiskinfo-aam-apm-control/

In general:

...

128=Minimum acoustic emanation level

...

254=Max performance

To change the AAM value type:

smartctl /dev/sd[a-h] -s aam,<off|1-254>

GUI: Enter the value then Click Apply

Note that not all the storage devices support this option and the value can be changed by the device internal firmware after reboot or plug/unplug event.

APM Status

Advanced Power Management: change power consumption (and performance) of a mass storage device.

Some infos about values: https://crystalmark.info/en/software/crystaldiskinfo/crystaldiskinfo-aam-apm-control/

In general:

1=Minimum power consumption with Standby

...

128=Minimum power consumption without Standby

...

254=Max performance

To change the APM value type:

smartctl /dev/sd[a-h] -s apm,<off|1-254>

GUI: Enter the value then Click Apply

Note that not all the storage devices support this option and the value can be changed by the device internal firmware after reboot or plug/unplug event.

Device Test

Make a device test with following commands:

smartctl --test=short /dev/sd[a-h] - short data test.

or

smartctl --test=long /dev/sd[a-h] - long data test.

Test will be executed in background mode.

Then type:

smartctl -l selftest /dev/sd[a-h] - to show test progresses and results.

Type:

smartctl -X /dev/sd[a-h] - to abort current test.

GUI

Select the kind of test to execute (Short or Long) then click Run Test to start the test.

Test will be executed in background mode.

Then click: Show Result after finishing.

Click: Abort Test to interrupt the current test.