This article explains how to perform the SMART short and extensive tests from the shell within Junos.
In order to determine the overall all health of a Routing Engine and in particular the Hard Drive it is useful to examine the results of the hard drive SMART tests. It is not always possible to run these commands from the CLI so and option to run them from the shell environment is needed.
It is possible to perform SMART tests from the shell environment and also get the results from these tests in order to determine the health of the hard drive. These tests and queries can however be only performed by the root users.
Note, that this shell command is not officially supported. On certain RE types this command might fail completely or partially. Even though the command is generally considered to be safe to run, it is highly recommended to do it in a maintenance window on production equipment and in consultation with JTAC.
Access the system shell environment as user root.
adelport@bristol> start shell user root Password: root@bristol%
To show ALL SMART information use the following command.
root@bristol% smartd -oa /dev/ad1
To execute the Extended Self Test use the following command.
root@bristol% smartd -oX /dev/ad1 Drive Command Successful, Extended Self test has begun Please wait 17 minutes for test to complete Use smartd -oA to abort test root@bristol%
To execute the Short Self Test use the following command.
root@bristol% smartd -oS /dev/ad1 Drive Command Successful, Short Self test has begun Please wait 2 minutes for test to complete Use smartd -oA to abort test root@bristol%
As the above two outputs suggest, the tests can always be stopped as follows.
root@bristol% smartd -oA /dev/ad1 Drive Command Successful, self test aborted root@bristol%
The test progress can be monitored using the following command
root@bristol% smartd -og /dev/ad1 General Smart Values: Off-line data collection status: (0x00) Offline data collection activity was never started Self-test execution status: ( 246) Self-test routine in progress 60% of test remaining Total time to complete off-line data collection: ( 645) Seconds Offline data collection Capabilities: (0x5b) SMART EXECUTE OFF-LINE IMMEDIATE Automatic timer ON/OFF support Suspend Offline Collection upon new command Offline surface scan supported 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 Short self-test routine recommended polling time: ( 2) Minutes Extended self-test routine recommended polling time: ( 17) Minutes root@bristol%
Note: When you see “ Self-test execution status” above is “( 0) The previous self-test routine completed without error or no self-test has ever been run”, that means SmartD test is completed.
Once the tests are completed the results can be seen using the following query.
root@bristol% smartd -oa /dev/ad1 Device: HTS548020M9AT00 Supports ATA Version 6, Firmware version MG1OA53A ATA/ATAPI revision 6 device model HTS548020M9AT00 serial number MRL122L1GP2NDB firmware revision MG1OA53A cylinders 16383 heads 16 sectors/track 63 lba supported 10624 sectors lba48 supported -4630042554031658624 sectors dma supported overlap not supported Feature Support EnableValue Vendor write cache yes no read ahead yes yes dma queued no no 0/00 SMART yes yes microcode download no no security yes no power management yes yes advanced power management yes yes 16576/40C0 automatic acoustic management yes no 254/FE 128/80 Drive supports SMART and is enabled Check SMART Passed General Smart Values: Off-line data collection status: (0x00) Offline data collection activity was never started 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 off-line data collection: ( 645) Seconds Offline data collection Capabilities: (0x5b) SMART EXECUTE OFF-LINE IMMEDIATE Automatic timer ON/OFF support Suspend Offline Collection upon new command Offline surface scan supported Self-test supported Smart Capablilities: (0x0003) Saves SMART data before entering power-saving mode Supports SMART auto save timer Error logging capability: (0x01) Error logging supported Short self-test routine recommended polling time: ( 2) Minutes Extended self-test routine recommended polling time: ( 17) Minutes Vendor Specific SMART Attributes with Thresholds: Revision Number: 16 Attribute Flag Value Worst Threshold Raw Value ( 1)Raw Read Error Rate 0x000b 100 100 062 000000000000 ( 2)Throughput Performance 0x0005 100 100 040 000000000000 ( 3)Spin Up Time 0x0007 201 201 033 001000000001 ( 4)Start Stop Count 0x0012 001 001 000 00000009b226 ( 5)Reallocated Sector Ct. 0x0033 100 100 005 000000000000 ( 7)Seek Error Rate 0x000b 100 100 067 000000000000 ( 8)Seek Time Preformance 0x0005 100 100 040 000000000000 ( 9)Power On Hours Count 0x0012 068 068 000 00000000379f ( 10)Spin Retry Count 0x0013 100 100 060 000000000000 ( 12)Power Cycle Count 0x0032 100 100 000 00000000002b (191)Gsense Error Rate 0x000a 100 100 000 000000000000 (192)Power Off Retract Count 0x0032 100 100 000 00000000000e (193)Load/Unload Cycle Count 0x0012 037 037 000 00000009b2b9 (194)Device Temperature 0x0002 177 177 000 08ee0000001f (196)Reallocation Event Ct. 0x0032 100 100 000 000000000007 (197)Current Pending Sec. Ct 0x0022 100 100 000 000000000000 (198)Offline Uncorrectable 0x0008 100 100 000 000000000000 (199)UDMA CRC Error Count 0x000a 200 200 000 000000000000 SMART Error Log: SMART Error Logging Version: 1 No Errors Logged SMART SelfTest Log: SMART SelfTest Logging Version: 1 Selftest Type Status Failure-LBA Timestamp Extended Successful None 14239 Extended Aborted None 14238 root@bristol%
These results are standard SMART results and are not specific to Junos. As such, searching the Internet for explanations for each attribute is useful.
The time stamp value reported in the results are in relation to attribute 9 “Power on Hours Count” and are reported in hours.