[smartmontools-support] using smartd to monitor a rotating group of USB drives?

Christian Franke Christian.Franke at t-online.de
Tue Nov 6 22:22:38 CET 2018


Nathan Stratton Treadway wrote:
> On Sun, Nov 04, 2018 at 19:51:32 +0100, Christian Franke wrote:
>>> B) when a new drive is plugged in, it appears that smartd doesn't check
>>>     to see if the drive now found as /dev/sdX is actually the same drive
>>>     as the one found at start-up time -- and thus over time multiple
>>>     different drives are all treated as the same drive, with data saved
>>>     the same /var/lib/smartmontools/*<DEVICE_MODEL>_<SERIAL_NUMBER>*
>>>     files (named after whatever happened to be plugged in at startup
>>>     time) -- and, I believe, any warning emails sent include the original
>>>     drive's info in the body of the message, rather than the info for the
>>>     drive that's actually attached at that time.
>> A platform independent solution is possibly difficult. It may work
>> to add another option (e.g. "-d replaceable") to enable a re-check
>> of device identity before each check cycle.
>   
> Is part of the issue that a normal check cycle doesn't retrieve the
> identity information from the drive?

Yes, only the initial device registration or a reload after SIGHUP 
retrieves devices identities. This didn't change since the early days of 
smartd (2002).


> Specifically for the "B)" issue, it seems like the platform shouldn't be
> an issue -- or, at least, the platform-dependent factors should be no
> greater than what already has been implemented: smartd must already get
> and parse the model+serial info when it first detects the device (since
> it names the state file, etc. using that info), so the question is
> whether it should repeat that same process each time it opens the
> device, to make sure the assumption that one physical device is
> associated with a particular /dev/ file continues to hold true.

This should be added, but requires some substantial reorganization of 
code and related testing. Will be addressed after next release.

Thanks,
Christian




More information about the Smartmontools-support mailing list