Bug 435699

Summary: Says my disk is doomed but I don't think so
Product: [Plasma] plasma-disks Reporter: Kai Uwe Broulik <kde>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Severity: normal CC: nate, sitter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.22.0
Attachments: Smart json output
screenshot of simulation
Smart json before enablin smart

Description Kai Uwe Broulik 2021-04-13 17:28:20 UTC
Created attachment 137566 [details]
Smart json output

Plugged in a newly bought 4 GiB HDD and got a scary warning, see attached log.

Linux/KDE Plasma: git master as of today

(There's also hardly any additional info like "we believe that because xyz")
Comment 1 Nate Graham 2021-04-13 17:58:27 UTC
   "messages": [
        "string": "Warning: This result is based on an Attribute check.",
        "severity": "warning"
Comment 2 Harald Sitter 2021-04-14 09:04:43 UTC
Created attachment 137584 [details]
screenshot of simulation

I'm not quite sure what to make of this. The firmware must have reported that the overall smart_status was failing earlier.

When I load that json blob into simulation mode it definitely doesn't get reported as failure - I'm attaching a screenshot. And indeed when walking through the code I don't see how it would be reported as one.

For bug #429804 a separate warning mode was introduced but that wasn't hit according to the picture you sent on telegram and indeed it wouldn't be because only bit 2 is set and that isn't mapped to a failure https://invent.kde.org/plasma/plasma-disks/-/blob/948eb1ddc324dde5442bda9474fe4166d944302b/src/instabilities.cpp#L18 if it was the KCM would even tell you what exactly indicates problems with the drive.
Comment 3 Kai Uwe Broulik 2021-04-14 09:08:13 UTC
Maybe it was because on first plug in smart was disabled? I had the same with another hdd. Will upload before and after turning in smart jsons later.
Comment 4 Harald Sitter 2021-04-14 09:27:00 UTC
If you maybe had the org.kde.plasma.disks category enabled journald might have some details on what went wrong.
Comment 5 Kai Uwe Broulik 2021-04-14 20:15:43 UTC
Created attachment 137611 [details]
Smart json before enablin smart

This was the other drive when I plugged it in
Comment 6 Harald Sitter 2021-04-15 09:42:20 UTC
Now THAT does make more sense. Thx
Comment 7 Bug Janitor Service 2021-04-15 10:15:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-disks/-/merge_requests/18
Comment 8 Harald Sitter 2021-04-15 13:08:54 UTC
Git commit b1914d5a1c6cf0ae957e1b07aec9f3c153ed6e2e by Harald Sitter.
Committed on 15/04/2021 at 13:08.
Pushed by sitter into branch 'master'.

consider devices invalid (ignore them) that have smart disabled

when SMART is disabled smartctl will exit0 but contain no smart_status
which means default values get used and the device is considered
invalid. since we don't know what the status is in this situation we'll
consider the entire data set invalid and thereby hide the device.

with the growing amount of potentially discarded (but present) data
blobs it might soon make sense to think about rendering invalid devices
in the KCM with an unknown state so people at least can find out that
their drives aren't being monitored
FIXED-IN: 5.22.0

A  +77   -0    autotests/fixtures/pass-without-status.json
A  +2    -0    autotests/fixtures/pass-without-status.json.license
M  +1    -0    autotests/fixtures/simulation.qrc
M  +15   -0    autotests/smartdatatest.cpp
M  +9    -0    src/smartdata.cpp