How to exclude a device from Storage Device Health Monitoring

Discussion in 'all things UNIX' started by Stupendous Man, May 8, 2023.

  1. Stupendous Man

    Stupendous Man Registered Member

    Joined:
    Aug 1, 2010
    Posts:
    2,870
    Location:
    the Netherlands
    Last week, I bought a new SanDisk Extreme PRO USB 3.2 Solid State Flash Drive 128 GB (SDCZ880-128G-G46). [1]
    I removed SanDiskSecureAccess and formatted the drive as EXT4.

    With SanDisk Extreme PRO USB flash drives, there's an issue. It generates a false positive Storage Device Health Monitoring prefailure warning. This was reported many times, also with earlier versions of the SanDisk Extreme PRO USB 3. [2], [3], [4], [5], [6], [7], [8]

    On my two Kubuntu 22.04 systems, GSmartControl [9] is installed and therefore smartmontools [10], containing smartctl and smartd. smartd is the SMART disk monitoring daemon.

    On my Kubuntu systems, inserting the SanDisk Extreme PRO USB 3.2 generates a Storage Device Health Monitoring warning, saying "The storage device SanDisk Extreme Pro ('/dev/xxx') is likely to fail soon!"
    The SMART DATA details say: Perc_Avail_Resrvd_Space; Pre-fail; FAILING_NOW.

    In smartmontools issue 147, chrfranke wrote:
    "This suggests that Sandisk uses SSD firmware with SMART support for a flash drive. Flash drives typically have no spare blocks, so the constant zero VALUE and RAW_VALUE of attribute 232 actually make sense. The THRESHold should also be zero but is not which results in FAILED SMART status." [11]
    "The -x output suggests that the SMART support is a fake, including a false positive FAILED status.
    Conclusion: This is a firmware bug. It cannot be fixed by smartctl." [12]


    As this seems to be a common issue with these SanDisk Extreme PRO USB 3 flash drives, and the prefailure warning is annoying, I'd like to exclude the device from Storage Device Health Monitoring.

    The simple option is to set the device as ignored in Kubuntu Info Center\ Devices\ SMART Status.
    However, this selects for instance /dev/cdc or /dev/cdd. This is not a constant for the device, it depends on which external devices are connected and in which order.
    If I would like to ignore the SanDisk Extreme PRO USB 3.2 flash drive using this option, I would need to ignore other external devices as well. So this is not ideal.


    Another option would be to ignore the device by editing /etc/smartd.conf
    This could be done by adding a line before the DEVICESCAN line, including the device's symlink and -d ignore, and adding -d by-id to the DEVICESCAN line. [13]
    The device's symlink can be found listing devices by id:
    ls -la /dev/disk/by-id/*

    After saving the edited smartd.conf, the system must be rebooted, or the SMART monitoring daemon restarted:
    sudo systemctl stop smartmontools.service
    # Remove USB flash drive
    sudo systemctl start smartmontools.service
    # Insert USB flash drive

    N.B.
    Modifying smartd.conf as mentioned did NOT make a difference. :(
    Inserting SanDisk Extreme PRO USB 3.2 still generates a Storage Device Health Monitoring prefailure warning.

    So now I wonder what I did wrong.

    My default DEVICESCAN configuration was:
    DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner

    I tried several configurations:
    simply adding -d by-id between DEVICESCAN and the default -d,
    the same, but with removing that second -d,
    even adding -d by-id -a, as was done in smartmontools ticket #1390 [13], but this did not work either (and I think -a should not be in DEVICESCAN configuration, as I suppose it is not included for a reason, so that smartd will not try to open all available devices).


    I'm out of ideas, except for setting all external devices to be ignored in Kubuntu Info Center\ Devices\ SMART Status (which is not ideal), or simply ignoring the Storage Device Health Monitoring prefailure warning each time I insert the SanDisk Extreme PRO USB 3.2 flash drive.

    Do you have any idea what I did wrong editing /etc/smartd.conf?
    Or do you have a better idea to exclude a specific device from Storage Device Health Monitoring?
    Thanks very much! :)
     
  2. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
  3. Stupendous Man

    Stupendous Man Registered Member

    Joined:
    Aug 1, 2010
    Posts:
    2,870
    Location:
    the Netherlands
    Thanks very much, summerheat.
    The option mentioned on that page is to specify devices by-uuid and ignore all other devices. Yes, that is an option, I think it was the best way before the relatively new -d ignore and add -d by-id option.
    However, I would very much like to ignore only that one specific USB flash drive without the need to specify anything else. For that purpose, the -d ignore and add -d by-id option was very promising. If only I could make it work. :)
     
  4. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
    I found this and this which might be helpful.
     
  5. Stupendous Man

    Stupendous Man Registered Member

    Joined:
    Aug 1, 2010
    Posts:
    2,870
    Location:
    the Netherlands
    Thanks very much, summerheat.
    I found both, too.

    In the first one, the StackExchange thread, derobert's reply suggested specifying individual devices (and ignore other devices), comparable to what is on the S.M.A.R.T. ArchWiki page that you mentioned.

    Rogach's referral in the StackExchange thread is how I found the second one, smartmontools ticket #1390. That one is what I referred to in my original post with my reference [13].

    However, the StackExchange thread is 9 years old.
    Smartmontools ticket #1390, mentioning the -d ignore and add -d by-id option, is more recent, 3 years old.
    -d by-id was first mentioned in smartmontools NEWS 2018-12-30, regarding smartmontools release 7.0. [14], [15]
    I'm still hoping to find the right configuration to make -d ignore and -d by-id work, as it did for rogach in Smartmontools ticket #1390.
     
  6. Stupendous Man

    Stupendous Man Registered Member

    Joined:
    Aug 1, 2010
    Posts:
    2,870
    Location:
    the Netherlands
    For now, I've settled for registering the device as Ignored in Kubuntu Info Center\ Devices\ SMART Status\ Storage Device Health Monitoring, the device registered as SanDisk Extreme Pro (/dev/sdc).
    Generally, that will be OK, as in most cases it will be at /dev/sdc.
    The few times it may be at /dev/sdd, I will ignore the warning, or perhaps I'll register /dev/sdd as ignored as well.
     
  7. summerheat

    summerheat Registered Member

    Joined:
    May 16, 2015
    Posts:
    2,199
    I'm glad that you found a solution that works for you!
     
  8. Stupendous Man

    Stupendous Man Registered Member

    Joined:
    Aug 1, 2010
    Posts:
    2,870
    Location:
    the Netherlands
    Thanks, summerheat.
    It would have been nice if I had been able to find the right configuration to make -d ignore and -d by-id work, but registering the device as ignored in Kubuntu Info Center settings is OK.

    Regarding the approach of smartd.conf configuration using -d ignore and -d by-id, I've seen that mentioned in smartmontools ticket #1390 [13] only. The fact that -d by-id was first mentioned in smartmontools NEWS 2018-12-30, but still is not in current smartmontools manpages or any other documentation that I could find, makes me think -d by-id is not widely used and it will be hard to find support.
    So I'm happy with my ignore settings in Kubuntu Info Center.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.