Bug 1139314 - smartd does not adjust the list of drives that it scans
Summary: smartd does not adjust the list of drives that it scans
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: smartmontools
Version: 19
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-08 15:55 UTC by Dale R. Worley
Modified: 2014-09-09 06:42 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-09-09 06:42:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
/etc/smartmontools/smartd.conf from the system (I have not customized it.) (6.65 KB, text/plain)
2014-09-08 15:55 UTC, Dale R. Worley
no flags Details

Description Dale R. Worley 2014-09-08 15:55:29 UTC
Created attachment 935402 [details]
/etc/smartmontools/smartd.conf from the system (I have not customized it.)

Description of problem:

If I boot the system with a USB disk drive attached, smartd discovers that the drive exists and monitors it.  But if I later unplug the drive, smartd does not realize that the drive is physically not present, and repeatedly reports that it cannot contact the drive.

(I suspect that the reverse error happens as well, that if a drive is later plugged in, smartd will not start monitoring the drive unless smartd is restarted.  But I have not verified this.)

Version-Release number of selected component (if applicable):

smartmontools-6.2-4.fc19.x86_64
Fedora release 19 (Schrödinger’s Cat)
Linux hobgoblin.ariadne.com 3.14.17-100.fc19.x86_64 #1 SMP Thu Aug 14 17:17:26 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

/etc/smartmontools/smartd.conf is not customized.

How reproducible:

Reliably reproducible.

Steps to Reproduce:
1. Boot system with a USB disk drive attached.
2. Once the system is running, disconnect the USB disk drive.

Actual results:

root will receive periodic e-mail messages like:

From: root <root>
Date: Fri, 05 Sep 2014 09:07:47 -0400
To: root.com
Subject: FailedReadSmartData

Device: /dev/sdb [USB JMicron], failed to read SMART Attribute Data

Messages appear in /var/log/messages like:

Sep  7 03:37:45 hobgoblin smartd[631]: Device: /dev/sdb [USB JMicron], open() failed: No such device

Expected results:

smartd should be aware of what drives are present and test all (and only) drives that are present.  This would prevent the messages that are being seen from being generated.

(I admit that there is a problem regarding the inaccessibility of drives that the user expects to be accessible, i.e., complete drive failure.  But in situations like that, the user usually becomes very aware of the drive failure long before smartd gives a report.)

Additional info:

I use a script to perform similar SMART monitoring.  It uses a simple shell command to get a list of drives every time it runs.  The script seems to be quite reliable in regard to this issue:

# Use /proc/partitions to find all the disks.
DISKS="$( </proc/partitions tail -n +3 | 
          awk '{ print $4 }' | 
          grep '^sd[^0-9]*$' |
          sort -u )"

However, this would need to be enhanced to at least locate hdX drives.

Comment 1 Michal Hlavinka 2014-09-09 06:42:28 UTC
smartmontools does not support hotplug. Upstream request was created some time ago.

http://www.smartmontools.org/ticket/60


Note You need to log in before you can comment on or make changes to this bug.