Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#1036 closed defect (fixed)

DEVICESCAN / --scan fails if multiple types specified

Reported by: olifre Owned by: Christian Franke
Priority: major Milestone: Release 7.0
Component: all Version: 6.6
Keywords: linux Cc:

Description

$ smartctl -d ata -d sat -d scsi -d nvme --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*

$ smartctl -d ata --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*

$ smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device

$ smartctl -d scsi -d ata --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*

For this reason, the recommendation at:
https://www.smartmontools.org/ticket/657?cversion=0&cnum_hist=8#comment:22
to use

DEVICESCAN -d ata -d scsi -d sat -d nvme -a

can also never work. There appears to be no way to DEVICESCAN for mixed devices including nvme unless support is explicitly compiled in.

Change History (9)

comment:1 by Christian Franke, 6 years ago

Milestone: undecided

Please always provide info about smartmontools platform and version (e.g. first smartctl output line).

comment:2 by olifre, 6 years ago

Ah, sorry, I thought selecting version 6.6 was sufficient. Here it is:

$ smartctl
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-22-generic] (local build)

The system is Ubuntu 18.04 LTS.

comment:3 by olifre, 6 years ago

Playing around, it seems manually creating:

mkdir /dev/discs

makes smartctl work as expected, i.e. all commands shown above work just fine.
But I don't have a good idea how to persist this directory, and I don't see why absence of it should prevent scan of devices.

in reply to:  2 comment:4 by Christian Franke, 6 years ago

Ah, sorry, I thought selecting version 6.6 was sufficient. ...

No, because the Debian maintainer of the smartmontools package decided to release from a SVN snapshot (the Ubuntu package follows Debian).
The final 6.6 release would print smartctl 6.6 2017-11-05 r4594 ....

comment:5 by Christian Franke, 6 years ago

Keywords: linux added
Milestone: undecidedRelease 6.7
Owner: set to Christian Franke
Status: newaccepted

Problem could be reproduced and is Linux specific. It occurs if no drive is found for one of the -d TYPE options. The root of the problem is an invalid handling of the GLOB_ABORT error code on missing /dev/discs. I will fix this soon.

Workaround for now:
Either mkdir /dev/discs or remove all -d TYPE options which fail. Using -d ata typically fails because it only scans for legacy /dev/hdX nodes.

Example

$ smartctl -d scsi -d sat -d nvme --scan

comment:6 by olifre, 6 years ago

Many thanks, also for the clear explanation!
Especially for Debian, I did not expect they'd cut out a snapshot rather than wait for an official release... Thanks for pointing this out.

The second workaround does sadly not work, though, on a system with only nvme-devices:

$ smartctl -d scsi -d sat -d nvme --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*

Also:

$ smartctl -d sat --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*
$ smartctl -d scsi --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*

So it seems to (also) happen in every case when no device for a given -d TYPE option, since on a system with no nvme devices, I get:

$ smartctl -d nvme --scan
# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*

Hope this helps.

So for now, the workaround for us will likely be to mkdir /dev/discs via Puppet.

comment:7 by Christian Franke, 6 years ago

Resolution: fixed
Status: acceptedclosed

comment:8 by olifre, 6 years ago

I can confirm this fixes it, many thanks! :-)

comment:9 by Christian Franke, 5 years ago

Milestone: Release 6.7Release 7.0

Milestone renamed

Note: See TracTickets for help on using tickets.