How to get SMART on external drives

    • #1

    I have a new OMV installation, and notice the SMART info is not being read for my external hard drives.

    On other linux installations I use commands like this to get SMART working on those same drives, and the addition of the option -d sat is key,

    smartctl --health -d sat /dev/sdb

    That particular command doesn't work on OMV and just gives an error,

    Read Device Identity failed: scsi error unsupported field in scsi command.

    The drives are seagate 2.5 inch drives.

    For instance this is what I have used in the past. Putting a file similar to this in /etc/cron.daily/ gives a daily SMART status email,

    #!/bin/sh
    (
    echo "==SDA=="
    smartctl --health /dev/sda
    echo "==SDB=="
    smartctl --health -d sat /dev/sdb
    echo "==SDC=="
    smartctl --health /dev/sdc
    echo "==SDD=="
    smartctl --health -d sat /dev/sdd
    echo "==SDE=="
    smartctl --health /dev/sde
    echo "==SDF=="
    smartctl --health /dev/sdf
    ) | /bin/mail -s 'NAS Status' youremailaddres@something.com

    • #2

    That particular command doesn't work on OMV

    SMART support for 'external' drives depends on

    • kernel version (especially with Seagate USB3 drives)
    • smartmontools version
    • USB-to-SATA bridge in the drive enclosures

    Since you did not provide information about your system or the error message further help is impossible.

    • #3

    Apologies.

    Open Media Vault, version 4.120-1 (Akkakis)
    Linux 4.19.0-0.bpo.2-amd64
    smartctl 6.6 2016-05-31

    smartctl --health -d sat /dev/sde

    Gives me this,

    Read Device Identity failed: scsi error unsupported field in scsi command.

    And,

    smartctl --health /dev/sde

    Gives me,

    Unknown USB bridge [0x0bc2:0x231a (0x710)]

    I'm not sure what you want me to provide about the USB-to-SATA bridge in the drive enclosures? I do know that these drives do run with the command -d sat on the other linux system I was running.

    sudo smartctl --health -d sat -a -T verypermissive /dev/sde

    smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.19.0-0.bpo.2-amd64] (local build)
    Copyright (C) 2002-16, Bruce Allen, Christian Franke, http://www.smartmontools.org

    Read Device Identity failed: scsi error unsupported field in scsi command

    === START OF INFORMATION SECTION ===
    Device Model: [No Information Found]
    Serial Number: [No Information Found]
    Firmware Version: [No Information Found]
    Device is: Not in smartctl database [for details use: -P showall]
    ATA Version is: [No Information Found]
    Local Time is: Tue Apr 2 19:03:23 2019 NZDT
    SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
    SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
    Checking to be sure by trying SMART RETURN STATUS command.
    SMART support is: Unknown - Try option -s with argument 'on' to enable it.
    Read SMART Data failed: scsi error unsupported field in scsi command

    • #4

    Linux 4.19.0-0.bpo.2-amd64

    I knew it. This kernel version is 'too new' since it contains a 'fix' that is somewhat counterproductive for SMART. Has been added with 4.14.

    You need to UAS blacklist your individual Seagate USB3 disks since otherwise SMART will always fail. See advice given here: Launch a custom script at reboot before system recognises USB devices

                                                                                        echo "options usb-storage quirks=0bc2:231a:u" >> /etc/modprobe.d/usb-storage-quirks.conf                                                                                                                    update-initramfs -u                                                                                                                    reboot                                                                              
    • #5

    It didn't work. But I hear you. I will continue to experiment with that, that gives me a good lead thanks.

    • #6

    It didn't work

    Well, this 'problem description' doesn't allow to help further. There's dmesg output you could look into and other stuff.

    Oh well, supporting OMV on x86 is soooo painstaking. If you would run OMV on ARM I would ask you for armbianmonitor -u output and would've all the information needed to help in one place.

    Note to myself: I should stop trying to support OMV on x86...

    • #7

    I was wrong. It is working on that one drive I set up. But how do I do it for multiple drives?

    Would this look right in /etc/modprobe.d/usb-storage-quirks.conf

    options usb-storage quirks=0bc2:231a:u
    options usb-storage quirks=0bc2:2322:u
    options usb-storage quirks=0bc2:2321:u

    Or should it have a different format for multiple drives? Or am I misunderstanding what the :u is for?

    I have this,

    lsusb -t
    /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M
    |__ Port 4: Dev 4, If 0, Class=Mass Storage, Driver=uas, 5000M
    /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M

    • #8

    But how do I do it for multiple drives?

    Comma separated. The link above was there for a reason. To learn exactly how to deal with multiple affected drives: https://github.com/ayufan-rock…ix_performance.sh#L32-L53

    • #9

    Final solution, find drive details,

    lsusb

    Bus 002 Device 003: ID 0bc2:2322 Seagate RSS LLC
    Bus 002 Device 002: ID 0bc2:231a Seagate RSS LLC
    Bus 002 Device 004: ID 0bc2:2321 Seagate RSS LLC Expansion Portable
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    Add multiple drives comma separated to /etc/modprobe.d/usb-storage-quirks.conf

                                                                                        echo "options usb-storage quirks=0bc2:231a:u,0bc2:2322:u,0bc2:2321:u" >> /etc/modprobe.d/usb-storage-quirks.conf                                                                                                                    update-initramfs -u                                                                                                                    reboot                                                                              

    lsusb -t

    /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 1: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 4: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M

    All drives are usb-storage, all good. All are showing a smart status in the OMV UI.

    • #10

    Final solution

    Only for you. Other users using other Seagate USB3 disks need to adopt the stuff and use the individual product IDs of their disks. But only when they run OMV on x86 (on ARM all of this happens automagically in the background).

    • #11

    Zitat

    Note to myself: I should stop trying to support OMV on x86...

    or -better- port armbianmonitor :-)

    • #12

    or -better- port armbianmonitor

    Armbianmonitor is a diagnostics tool in this mode helping to diagnose problems OMV users on ARM won't have anyway (since it makes no sense to leave Linux users owning those somewhat problematic Seagate USB disks with functionality that doesn't work -- so I fixed it in the first place).

    And all this stuff is part of the base system (Armbian or ayufan's images where I helped porting all the relevant parts so that for end users there's no difference whether using Armbian as base or an ayufan image).

    I don't remember exactly when but I asked both @votdev and @ryecoaaron already whether it would make sense to include such optimizations/tools into OMV or OMV-Extras (same with zram compressed RAM storage instead of tmpfs for example).

    • #13

    I don't remember exactly when but I asked both @votdev and @ryecoaaron already whether it would make sense to include such optimizations/tools into OMV or OMV-Extras

    Probably asked this before but I don't feel like finding it. Is it the format of Diagnostics -> System Information -> Report that you don't like or is it missing info that you want? We can add modules to /usr/share/openmediavault/sysinfo/modules.d to add more info to this report. Sending to ix.io would take a bit more work. Otherwise, I could add an entry to omv-extras that downloads armbianmonitor and executes armbianmonitor -u.

    • #14

    I've the same issue on ARM (rpi 3) with Seagate .

    Open Media Vault, version 4.1.22-1 (Arrakis)
    Linux 4.14.98-v7+ #1200
    smartctl 6.6 2016-05-31 r4324 [armv7l-linux-4.14.98-v7+] (local build)

    smartctl --health -d sat /dev/sda

    Read Device Identity failed: scsi error unsupported field in scsi command
    A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

    with -T permissive

    smartctl --health -d sat -T permissive -x /dev/sda

    Read Device Identity failed: scsi error unsupported field in scsi command

    === START OF INFORMATION SECTION ===
    Device Model: [No Information Found]
    Serial Number: [No Information Found]
    Firmware Version: [No Information Found]
    Device is: Not in smartctl database [for details use: -P showall]
    ATA Version is: [No Information Found]
    Local Time is: Thu May 16 23:55:02 2019 +04
    SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
    SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
    A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options

    I added UAS blacklist in /etc/modprobe.d/usb-storage-quirks.conf for this drive but it did not help.
    Actually without blacklisting lsusb -t shows that the driver is usb_storage and not uas:

    /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
    |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
    |__ Port 3: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 480M

    Output of armbianmonitor -u
    http://ix.io/1Jf0

    @tkaiser you mentioned "on ARM all of this happens automagically in the background" - looks like this is why blacklisting did not make any difference in Driver.
    Any idea what can be the problem ?

    Thanks

    • #15

    Actually without blacklisting lsusb -t shows that the driver is usb_storage and not uas

    Oh, the RPi folks enabled UAS while their USB driver still doesn't support UAS with latest kernel updates: https://github.com/raspberrypi/linux/issues/2813

    It seems they did this to get specific 'per device' quirks enabled.

    @tkaiser you mentioned "on ARM all of this happens automagically in the background" - looks like this is why blacklisting did not make any difference in Driver.

    It's a bit different. The mechanism to automagically UAS blacklist Seagate and WD USB3 disks only works on the 'normal' OMV ARM images. On the RPi there was no UAS support in the past.

    The reason for blacklisting all different Seagate USB3 disks was that they all suffer from the same problem (broken ATA pass-through support) described in this commit comment: https://github.com/raspberrypi…8d8212e28291b1a0243ecf2f1 -- after Hans committed this starting with kernel 4.14 the connection issues with Seagate USB3 disks on Linux should've been resolved while with the uas driver now a new problem occurred: not able to query the disk any more via SMART. That's why I decided to let Armbian still UAS blacklist all Seagate disks since being able to monitor drives via SMART is important in my opinion and with HDDs there's not much speed difference between usb-storage and uas anyway.

    But it seems this might now be the culprit. It would be great if you could double check with latest Raspbian release with all updates applied too whether you can query your disk via SMART there.

    • #16

    Thanks for the details @tkaiser.

    It would be great if you could double check with latest Raspbian release with all updates applied too whether you can query your disk via SMART there.


    I was planning to give it a try as you suggested, but noticed new kernel version is available for OMV (and some other libs too) and after updating to the new kernel version the problem with SMART has gone, it works as expected.

    Linux 4.19.42

    smartctl -x /dev/sda
    smartctl 6.6 2016-05-31 r4324 [armv7l-linux-4.19.42-v7+] (local build)
    Copyright (C) 2002-16, Bruce Allen, Christian Franke, http://www.smartmontools.org

    === START OF INFORMATION SECTION ===
    Model Family: Seagate Samsung SpinPoint M8 (AF)
    Device Model: ST1000LM024 HN-M101MBB
    Serial Number: S2ZPJ9DD420656
    LU WWN Device Id: 5 0004cf 20a1a8a5d
    Firmware Version: 2AR20002
    User Capacity: 1,000,204,886,016 bytes [1.00 TB]
    Sector Sizes: 512 bytes logical, 4096 bytes physical
    Rotation Rate: 5400 rpm
    Form Factor: 2.5 inches
    Device is: In smartctl database [for details use: -P show]
    ATA Version is: ATA8-ACS T13/1699-D revision 6
    SATA Version is: SATA 3.0, 3.0 Gb/s (current: 3.0 Gb/s)
    Local Time is: Sat May 18 19:57:52 2019 +04
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    AAM feature is: Disabled
    APM level is: 127 (intermediate level with standby)
    Rd look-ahead is: Enabled
    Write cache is: Enabled
    ATA Security is: Disabled, NOT FROZEN [SEC1]
    Wt Cache Reorder: Enabled

    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED

    • #17

    Linux 4.19.42

    Ah, RPi folks switched to the next LTS kernel already. May I ask for new armbianmonitor -u output to get the bigger picture?

    • #18

    Ah, RPi folks switched to the next LTS kernel already. May I ask for new armbianmonitor -u output to get the bigger picture?


    Sure, here it is http://ix.io/1Jrg

    • #19
                                                                                              echo "options usb-storage quirks=0bc2:231a:u" >> /etc/modprobe.d/usb-storage-quirks.conf                                                                                                                            update-initramfs -u                                                                                                                            reboot                                                                                    

    this works perfectly to me, i have seagate backup+ Hub BK

    • #20

    Good evening,

    I have a Seagate Backup Plus 5 TB (https://usb-ids.gowdy.us/read/UD/0bc2/ab28) which does not show SMART statistics for the reasons above; however a couple of differences:

    - Rpi 4B
    - OMV 5 (5.2.5-1 Usul)

    Would the solution still to be to echo "options usb-storage quirks=0bc2:ab28:u" >> /etc/modprobe.d/usb-storage-quirks.conf, then update-initramfs -u and finally reboot?

    I see from Workaround 1 at https://www.smartmontools.org/wiki/SAT-with-UAS-Linux that :u results in using the older slower driver usb-storage; if I think that the drive does not have the firmware bug, I can instead try Workaround 2 which keeps UAS but disables the quirk so that smartctl can interact with it - however I'm not sure of the risk involved, how to check that all is working correctly and right now where (which file) to add this to for Raspbian/OMV5... Any advice?

    BTW armbianmonitor does not seem to be installed anymore:

                                                                                        pi@raspberrypi:~ $ armbianmonitor -u                                                                                                                    -bash: armbianmonitor: command not found                                                                              

    I can post the output from Diagnostics / Report in case that helps.