devnullius
Patron
- Joined
- Dec 9, 2015
- Messages
- 289
Thanks. Any idea though how to do it with git?
+ Run SMART extended test on drive /dev/da2: Tue Oct 9 23:05:26 CDT 2018 +----------------------------------------------------------------------------- Extended test started, sleeping 0 seconds until it finishes Timeout polling for SMART self-test status smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) 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% 118 - Finished SMART extended test on drive /dev/da2: Wed Oct 10 03:08:20 CDT 2018
smartctl -l selftest /dev/da2 smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Extended offline Completed without error 00% 252 - # 2 Short offline Completed without error 00% 118 -
I've never tested the script with such large disks... Lucky you!Not sure if this is appropriate to post here but I loved the burn in script and wanted to report some weirdness (Maybe? unless I messed something up) I encountered running these on my 10TB WD Reds. Short SMART tests and badblocks ran fine but when it ran the long test, it seemed to not actually run.
Here is the snippet of the log from where it appeared to try to start, slept for 0 seconds then says it completed:
Code:+ Run SMART extended test on drive /dev/da2: Tue Oct 9 23:05:26 CDT 2018 +----------------------------------------------------------------------------- Extended test started, sleeping 0 seconds until it finishes Timeout polling for SMART self-test status smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) 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% 118 - Finished SMART extended test on drive /dev/da2: Wed Oct 10 03:08:20 CDT 2018
Is there anything I can test to assist in this? Not sure how to check this but I would like to help.
I did check the drive to see if it actually performed the test and it appears it did:
Code:smartctl -l selftest /dev/da2 smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Extended offline Completed without error 00% 252 - # 2 Short offline Completed without error 00% 118 -
Worth noting that in the script, it shows the last update is from June 8th, 2017 (from here: https://github.com/Spearfoot/disk-burnin-and-testing)
smartctl -c /dev/da2
command, this will tell us what's what. We're interested in the "Extended self-test routine recommended polling time" value.I've never tested the script with such large disks... Lucky you!
It may have something to do with how smartctl displays the device's estimated test durations. Sometimes, especially for larger drives, this is returned as 'hours+minutes' instead of a simple integer number of minutes -- which probably breaks my parsing code. If you will show the output of thesmartctl -c /dev/da2
command, this will tell us what's what. We're interested in the "Extended self-test routine recommended polling time" value.
Extended self-test routine recommended polling time: (1226) minutes.
There shouldn't be a lot of reasons to edit the script. This is one of the few. The polling time value might just be out of range / larger than what the script is looking for. The time it takes to run the test increases with drive size, so it will probably need a revision to accommodate larger drives.Worth noting that in the script, it shows the last update is from June 8th, 2017
Been busy lately and only just now had a chance to look into this...I will say I stumbled on a damn fine deal for the drives that I couldn't pass up. :D
As per your request, here is the value for the "extended self-test routine recommended polling time":
Code:Extended self-test routine recommended polling time: (1226) minutes.
Thinking on this some more, these were brand new drives before I tried to run the burn in script on them. Is it possible that since a smart self-test was never done on them before hand, there was no polling time already noted on the drive?
sleep
command seems perfectly willing to sleep for 73,560 seconds. Dry_Run
variable to a non-zero thus: Dry_Run=1
. Run this script against one of your huge drives, e.g., ./disk-burnin-sh da2
. Because we're doing a 'dry run', this won't actually run any tests against your drive, but it will generate a log showing what would happen during a normal run. The first chunk of this log is what I'd like to see, as it will tell us the sleep durations in both seconds and minutes, for both the short and long tests. Post it here, in code blocks, and we'll go from there.+----------------------------------------------------------------------------- + Started burn-in of /dev/da7 : Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- Host: bandit.spearfoot.net Drive Model: WDC_WD6001FZWX-00A2VA0 Serial Number: WD-XXXXXXXXXXXX Short test duration: 2 minutes Short test sleep duration: 120 seconds Extended test duration: 579 minutes Extended test sleep duration: 34740 seconds Log file: ./burnin-WDC_WD6001FZWX-00A2VA0_WD-XXXXXXXXXXXX.log Bad blocks file: ./burnin-WDC_WD6001FZWX-00A2VA0_WD-XXXXXXXXXXXX.bb +----------------------------------------------------------------------------- + Run SMART short test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART short test and sleep 120 seconds until the test finishes Finished SMART short test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- + Run badblocks test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- Dry run: would run badblocks -b 4096 -wsv -o ./burnin-WDC_WD6001FZWX-00A2VA0_WD-XXXXXXXXXXXX.bb /dev/da7 Finished badblocks test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- + Run SMART short test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART short test and sleep 120 seconds until the test finishes Finished SMART short test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- + Run SMART extended test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART extended test and sleep 34740 seconds until the test finishes Finished SMART extended test on drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- + SMART information for drive /dev/da7: Wed Oct 31 19:16:13 CDT 2018 +----------------------------------------------------------------------------- smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build)
+----------------------------------------------------------------------------- + Started burn-in of /dev/da2 : Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Host: freenas.local Drive Model: WDC_WD100EZAZ-11TDBA0 Serial Number: 2YHTLYYD Short test duration: minutes Short test sleep duration: 0 seconds Extended test duration: minutes Extended test sleep duration: 0 seconds Log file: ./burnin-WDC_WD100EZAZ-11TDBA0_2YHTLYYD.log Bad blocks file: ./burnin-WDC_WD100EZAZ-11TDBA0_2YHTLYYD.bb +----------------------------------------------------------------------------- + Run SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART short test and sleep 0 seconds until the test finishes Finished SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART extended test and sleep 0 seconds until the test finishes Finished SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run badblocks test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would run badblocks -b 4096 -wsv -o ./burnin-WDC_WD100EZAZ-11TDBA0_2YHTLYYD.bb /dev/da2 Finished badblocks test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART short test and sleep 0 seconds until the test finishes Finished SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART extended test and sleep 0 seconds until the test finishes Finished SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + SMART information for drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
Thank you very much.Not a problem, here are the results
Code:+----------------------------------------------------------------------------- + Started burn-in of /dev/da2 : Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Host: freenas.local Drive Model: WDC_WD100EZAZ-11TDBA0 Serial Number: 2YHTLYYD Short test duration: minutes Short test sleep duration: 0 seconds Extended test duration: minutes Extended test sleep duration: 0 seconds Log file: ./burnin-WDC_WD100EZAZ-11TDBA0_2YHTLYYD.log Bad blocks file: ./burnin-WDC_WD100EZAZ-11TDBA0_2YHTLYYD.bb +----------------------------------------------------------------------------- + Run SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART short test and sleep 0 seconds until the test finishes Finished SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART extended test and sleep 0 seconds until the test finishes Finished SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run badblocks test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would run badblocks -b 4096 -wsv -o ./burnin-WDC_WD100EZAZ-11TDBA0_2YHTLYYD.bb /dev/da2 Finished badblocks test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART short test and sleep 0 seconds until the test finishes Finished SMART short test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + Run SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- Dry run: would start the SMART extended test and sleep 0 seconds until the test finishes Finished SMART extended test on drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- + SMART information for drive /dev/da2: Wed Oct 31 20:11:55 CDT 2018 +----------------------------------------------------------------------------- smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
smartctl -c /dev/da2 > spearfoot_info.txt
? This will write all of the smartctl
output into a file named 'spearfoot_info.txt'. You can, of course, use whatever filename you like; it really doesn't matter. If you'll post the file contents here (in code tags), I can use it to test the script's parsing code and see about finding and fixing the bug.smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === 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: ( 93) 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: (1226) minutes. SCT capabilities: (0x003d) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported.
Curiouser and curioser...Done and done
Code:smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === 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: ( 93) 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: (1226) minutes. SCT capabilities: (0x003d) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported.
Short_Test_Minutes=$(cat ./input.txt | pcregrep -M "Short self-test routine.*\n.*recommended polling time:" | sed -e 's/)//;s/(//' | awk '{print $4}' | tr -d '\n') Extended_Test_Minutes=$(cat ./input.txt | pcregrep -M "Extended self-test routine.*\n.*recommended polling time:" | sed -e 's/)//;s/(//' | awk '{print $4}' | tr -d '\n')
Short test duration: 2 minutes Short test sleep duration: 120 seconds Extended test duration: 1226 minutes Extended test sleep duration: 73560 seconds
tar -c -f script_tarball disk-burnin.sh
should do the trick... then send me the file script_tarball. I'll take a look at your script and see how things stand.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% 118 -
########## SMART status report summary for all drives on server FREENAS ########## +------+------------------+-----+-----+-----+-----+-------+-------+--------+------+---------+------+-------+----+ |Device|Serial |Temp |Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High |Command|Last| | |Number | |On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly |Timeout|Test| | | | |Hours|Count|Count| |Sectors|Sectors | | |Writes|Count |Age | +------+------------------+-----+-----+-----+-----+-------+-------+--------+------+---------+------+-------+----+ |da0 |WD-************ | 30 | 486| 142| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 1| |da1 ? |WD-************ | 28 | 957| 142| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 2*| |da2 ? |WD-************ | 29 | 954| 142| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 2*| |da3 ? |WD-************ | 28 | 953| 142| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 2*| |da4 ? |WD-************ | 28 | 955| 142| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 2*| |da5 ? |WD-************ | 28 | 951| 142| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 2*| |da6 |WD-************ | 29 | 486| 140| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 1| |da7 ? |WD-************ | 28 | 599| 39| 0| 0| 0| 0| N/A| N/A| N/A| N/A| 2*| |ada0 ?|5*************** | 32 | 148| | | 0| 0| | N/A| N/A| N/A| N/A| 6*| |ada1 ?|SMC*****************| 37 | 1077| | | 0| 0| 0| N/A| N/A| N/A| N/A| 45*| |ada2 ?|SMC*****************| 40 | 1077| | | 0| 0| 0| N/A| N/A| N/A| N/A| 45*| +------+------------------+-----+-----+-----+-----+-------+-------+--------+------+---------+------+-------+----+
It looks like you need to run a short test daily on all your drives and a long test weekly. That should eliminate the question marks and asterisks.Also
It looks like you need to run a short test daily on all your drives and a long test weekly. That should eliminate the question marks and asterisks.
I've modifed the script to support 24-character serial numbers and committed the updated version to GitHub.Why does it flag the test age so soon? I was wondering that...
But that isn't the problem. With the question marks Serial Number column is align perfectly with Device and Temp excluding SATADOMs. Asterisks in the last column don't affect the column width.
I've modifed the script to support 24-character serial numbers and committed the updated version to GitHub.
echo "########## SMART status report for ${drive} drive (${brand}: ${serial}) ##########" "${smartctl}" -n never -H -A -l error /dev/"${drive}" "${smartctl}" -n never -l selftest /dev/"${drive}" | grep "# 1 \|Num" | cut -c6- ) >> ${logfile}
echo "########## SMART status report for ${drive} drive (${brand}: ${serial}) ##########" "${smartctl}" -n never -H -A -l error /dev/"${drive}" "${smartctl}" -n never -l selftest /dev/"${drive}" | grep "# 5 \|# 4 \|# 3 \|# 2 \|# 1 \|Num" ) >> ${logfile}
You can also use theThanks you for a quick fix, now it looks great.
I also solved the past SMART test result problem where I replaced this section
Code:echo "########## SMART status report for ${drive} drive (${brand}: ${serial}) ##########" "${smartctl}" -n never -H -A -l error /dev/"${drive}" "${smartctl}" -n never -l selftest /dev/"${drive}" | grep "# 1 \|Num" | cut -c6- ) >> ${logfile}
with this
Code:echo "########## SMART status report for ${drive} drive (${brand}: ${serial}) ##########" "${smartctl}" -n never -H -A -l error /dev/"${drive}" "${smartctl}" -n never -l selftest /dev/"${drive}" | grep "# 5 \|# 4 \|# 3 \|# 2 \|# 1 \|Num" ) >> ${logfile}
Now it will print 5 previous test results.
smartctl
'xselftest' option to return the 'n' most recent test results. I haven't modified the script to use it because it a> may not work for all drives and b> may not be present in older versions of the program. Here is the call to return the 5 most recent test results:root@bandit:~ # smartctl -n never -l xselftest,5 /dev/da4 smartctl 6.6 2017-11-05 r4594 [FreeBSD 11.1-STABLE amd64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Extended Self-test Log Version: 1 (1 sectors) Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 14991 - # 2 Short offline Completed without error 00% 14967 - # 3 Short offline Completed without error 00% 14943 - # 4 Short offline Completed without error 00% 14919 - # 5 Short offline Completed without error 00% 14895 -