Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
smart selftest log parsing error during self tests #1207
Some hdd models eg Seagate ST3000VN000 update their Self-Test logs during a test rather than only after the test is complete. But this live update is not elegantly dealt with by the current parsing system and causes the following error to be thrown directly after initiating a self test:
this blocks smart refreshes for the drive in question during the period of the self test (ie up to 6.6 hours) and is due to a parser failing to split the appropriate fields.
A normal line output from /usr/sbin/smartctl -l selftest -l selective /dev/sda:
A problematic line is of the form:
Given we currently split by multiple space the problematic "Self-test routine in progress 10%" is read as a single entry as all other columns can be split by multiple spaces but in this case we have only one between the "progress" and "10%", this in turn leads to an error as the following field is wrongly assumed to be a percentage.
I have started to approach this issue and hope to make more progress soon.
added a commit
Mar 6, 2016
N.B. Only had a quick look at this since opening but looks like the indicated error is only generated in the fist 9 hours of drive life, ie single digit drive lifetime. But parsing of the self test log is still faulty there after, only without generating the error.
The following is the result of the current parsing while a test is active and the drive is 2 digit hours old.
Using an edited file dump of the output from /usr/sbin/smartctl -l selftest -l selective /dev/sda I have recreated the original smartcrt output and with TESTMODE = True proved the above specialize parser for this circumstance. The following previously problematic Self-Test log entry:
is now correctly parsed as follows:
in the Self-Test Logs entry (spaces added here to help readability).