Opened 18 months ago

Closed 9 months ago

#1299 closed enhancement (fixed)

--scan and DEVICESCAN shouldn't return ses devices on FreeBSD

Reported by: asomers Owned by: Alex Samorukov
Priority: minor Milestone: Release 7.2
Component: all Version: 7.0
Keywords: freebsd Cc:

Description (last modified by Christian Franke)

On FreeBSD, SCSI Enclosure Services devices show up as /dev/sesX. These devices don't support SMART, or any related SCSI log pages, so they ought to be suppressed from the output of smartctl --scan.

Here's an example output of smartctl -a /dev/ses0. Not much to see here:

$ sudo smartctl -a /dev/ses0
smartctl 7.0 2018-12-30 r4883 [FreeBSD 12.1-STABLE amd64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               NEWISYS
Product:              NDS-4600-JD
Revision:             0509
Compliance:           SPC-3
Logical Unit id:      0x500093d001896000
Serial number:        MXE3400043PRB07A
Device type:          enclosure
Transport protocol:   SAS (SPL-3)
Local Time is:        Thu Feb 13 02:50:39 2020 UTC
SMART support is:     Unavailable - device lacks SMART capability.

=== START OF READ SMART DATA SECTION ===
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging


$ smartctl --version
smartctl 7.0 2018-12-30 r4883 [FreeBSD 12.1-STABLE amd64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

smartctl comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it under
the terms of the GNU General Public License; either
version 2, or (at your option) any later version.
See http://www.gnu.org for further details.

smartmontools release 7.0 dated 2018-12-30 at 14:47:55 UTC
smartmontools SVN rev 4883 dated 2018-12-30 at 14:48:54
smartmontools build host: amd64-portbld-freebsd12.1
smartmontools build with: C++14, GCC 4.2.1 Compatible FreeBSD Clang 8.0.1 (tags/RELEASE_801/final 366581)
smartmontools configure arguments: '--disable-dependency-tracking' '--enable-sample' '--with-nvme-devicescan=yes' '--with-initscriptdir=/usr/local/etc/rc.d' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/man' '--disable-silent-rules' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd12.1' 'build_alias=amd64-portbld-freebsd12.1' 'CXX=c++' 'CXXFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  ' 'LDFLAGS= -fstack-protector-strong ' 'LIBS=' 'CPPFLAGS=' 'CC=cc' 'CFLAGS=-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing '

Change History (6)

comment:1 Changed 18 months ago by Christian Franke

Description: modified (diff)

comment:2 Changed 18 months ago by Christian Franke

Component: smartctlall
Keywords: freebsd added; FreeBSD removed
Milestone: Release 7.2
Summary: --scan shouldn't return ses devices on FreeBSD--scan and DEVICESCAN shouldn't return ses devices on FreeBSD

comment:3 Changed 9 months ago by Alex Samorukov

Hi, i do not have ses device around, could you please test this patch:

--- os_freebsd.cpp	(revision 5103)
+++ os_freebsd.cpp	(working copy)
@@ -1591,6 +1591,10 @@
           skip_device = 1;
         else
           skip_device = 0;
+
+        // skip ses devices
+        if (dev_result->inq_data.device == T_ENCLOSURE)
+          skip_device = 1;

         //        /* Shall we skip non T_DIRECT devices ? */
         //        if (dev_result->inq_data.device != T_DIRECT)

If it works for you - i will merge.

Last edited 9 months ago by Alex Samorukov (previous) (diff)

comment:4 Changed 9 months ago by Alex Samorukov

Owner: set to Alex Samorukov
Status: newassigned

comment:5 Changed 9 months ago by Alex Samorukov

Committing it as it should not do any harm. Anyway, feedback is welcome

comment:6 Changed 9 months ago by Alex Samorukov

Resolution: fixed
Status: assignedclosed

Fixed in r5104

Note: See TracTickets for help on using tickets.