Read device identity failed scsi error unsupported field in scsi command

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,…


    • #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).

    • Offizieller Beitrag
    • #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.

I had the same problem. In my case, S.M.A.R.T had been working properly on the device for years while using Ubuntu 12.04, and then under Ubuntu 14.04 it happened exactly what you tell in the question.

The problem is related to a new kernel module that was introduced in Linux Kernel 3.15 called uas (USB Attached SCSI) (see release announcement).

That module is now the responsible of managing USB Mass Storage Devices. There is a thread where people complain that uas in kernel 3.15 is causing their USB devices to fail. Another one says that it might be the cause of S.M.A.R.T problems.

Fortunately, those problems seem to be gone at kernel 3.19 (which I am using), as my device is being detected correctly. Only the S.M.A.R.T problem remains.

To fix it, you need to disable the use of uas module for the given device.

Disable uas without rebooting

First, unplug all USB devices that might be using it. Then, remove the uas and usb-storage modules:

sudo modprobe -r uas
sudo modprobe -r usb-storage

Then, load usb-storage module with a parameter that tells it to not use uas for a given device:

sudo modprobe usb-storage quirks=VendorId:ProductId:u

VendorId and ProductId must be replaced by your device vendor and product id, which can be obtained with lsusb command (they are the characters after ID).

For example, I have the following device:

Bus 002 Device 011: ID 0bc2:3320 Seagate RSS LLC SRD00F2 [Expansion Desktop Drive]

So my vendor id is 0bc2, and my product id is 3320. My command is:

sudo modprobe usb-storage quirks=0bc2:3320:u

The last u tells usb-storage to ignore uas for the device (see source).

At this point, you can insert the USB device, and it will know not to use uas, making S.M.A.R.T work properly. You will see lines like these in dmesg when inserting the USB device:

usb 2-2: UAS is blacklisted for this device, using usb-storage instead
usb-storage 2-2:1.0: USB Mass Storage device detected
usb-storage 2-2:1.0: Quirks match for vid 0bc2 pid 3320: 800000
scsi host12: usb-storage 2-2:1.0

Make the change permanent

The previous quirk will only last until you reboot the system. To make it persistent, you need to follow the steps described here, which I copy below:

First, create a file named ignore_uas.conf in the /etc/modprobe.d/ directory with the following content:

options usb-storage quirks=VendorId:ProductId:u

As before, substitute VendorId and ProductId by your device vendor and product id obtained from lsusb.

Next, regenerate your inital ramdisk:

mkinitcpio -p linux

or, on newer Ubuntu versions:

sudo update-initramfs -u

Finally, reboot your computer.


Edit:
More background on the issue, and another way to get around it without disabling uas (which has better throughput than usb-storage) can be found here: https://www.smartmontools.org/ticket/971#comment:12

It seems that kernel is blacklisting SAT ATA PASS-THROUGH on some devices when running in uas mode, as they have broken firmware.

So, the blacklisting can be disabled (at your own risk) by using the previous method I mention in the answer, but removing the final u from the quirk, ie:

quirks=VendorId:ProductId:

Please note, however, that I have not tested this approach.

Содержание

  1. Отвалился SMART на внешнем HDD
  2. Debian User Forums
  3. smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT SAS
  4. smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT SAS
  5. Re: smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT
  6. Re: smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT
  7. smartctl questions (newbie) for Silicon Power 1TB caddy USB external HD
  8. 1 Answer 1
  9. How to get SMART on external drives

Отвалился SMART на внешнем HDD

Есть внешний usb-винт Seagate Expansion STEA4000400 (опознаётся как ST4000LM016), подключен через хаб. Ещё пару недель всё было нормально и я спокойно мониторил температуру и reallocated sector count (коих было ноль). А сейчас куда-то всё успело отвалиться.

Хорошо, Disabled, бывает. Пытаюсь включить:

Попробуйте откатить ядро.

Далеко не все usb-sata адаптеры поддерживают SMART, может что-то отвалилось, попробуй другой. Проверь также на Windows, это может софтовая проблема, хоть и вряд ли.

консоль к винту и сброс смарта.

/1 и на уровне 1> команда N1

Эта процедура обнуляет данные SMART? То есть фактически можно затереть смарт и продать ушатанный дисп как почти новый?

обнуляет, но не все. пендинги/реаллокейты никуда не деваются к примеру (т.к. в дефект-листах). на некоторых моделях вроде время наработки тоже не сбрасывается.

Откат ядра до старого гарантированно рабочего или обновление до нового ничего не дали. К слову, у трёх других подключенных винтов SMART работает нормально

usb-sata адаптер встроен в заводскую коробку внешнего винта и я с ними ничего особенного не делал

Консоль к винту выглядит немножко перебором, этот совет я пожалуй отложу на крайний случай)

Откат ядра до старого гарантированно рабочего или обновление до нового ничего не дали.

А какие ядра из серии 4.14.x побывали в работе? Там были страшные регресс-баги с блочными устройствами.

Откатывался на 4.14.5, там у меня ещё всё работало если ничего не напутал. Топик создал на 4.14.8, вчера обновился до 4.14.9. Арч

Интересный факт: вин7 в виртуалбоксе прекрасно видит весь SMART, а линукс — ни в какую, хотя я с момента создания темы уже стопицот раз обновлялся и стопицот раз перезагружался.

Подозреваю, «консоль к винту» в таком случае ничего не изменит

Источник

Debian User Forums

smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT SAS

#1 Post by superbob » 2013-06-30 20:43

My symptoms are exactly like the ones described here, and instructions in this thread were not helpful to me: http://marc.info/?t=132193889600001&r=1&w=2

I’ve tried megaraid,[0-32], didn’t work.

/dev/sda is a 2TB Seagate HDD:

2011, which was when I first got the controller. I haven’t tried it on a 32bit kernel. I might do it just to see it work, but that is not a solution for me.

TBH I don’t know where to start looking for solutions. I was hoping that this would be fixed by now. Until recently I’ve switched to a different controller, but now ended up having to plug this one back in.

Any suggestions regarding a solution or a course of action that might lead to making this work would be welcome

Re: smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT

#2 Post by betterpingpong » 2013-08-27 14:42

Re: smartmontools and Symbios Logic SAS1068 PCI-X Fusion-MPT

#3 Post by tomazzi » 2013-08-27 20:55

ehh.
Well, why do You suppose it’s possible to get smartmotools talking with an abstracion layer provided by RAID bios module interface?
To make things clear: HW Raid controllers are embedded systems, wich are supposed to behave like a single disk (no matter what the Raid Level is) — so they are responding to standard ATA commands, but they are unable to report SMART status, because it’s an array of disks. So: the tool used for reading SMART has to know that it is talking with Raid Ctrl and it must know how to get array structure information and how to reference its members.
Definitively smartmontools are for single disk drives and they just don’t know about existence of RAID controllers — and therefore it will never work.

Smartmontools WILL work for mdadm and dmraid — because these are kernel-level Raid arrays, so each of their members is accessible separately as normal disk.

There are (sometimes) dedicated programs for viewing SMART on particular Raid members on proprietary RAID systems, but in MOST CASES it’s not helpful — because most likely Raid Contrller will drop supposedly damaged array members BEFORE You’ll decide to check their SMART status.

Therefore, although mdadm is much slower in comparison to HW Raid controllers, its at the same time more safe — You can have kernel logs containing every single problem with the drive BEFORE it will be dropped from array.

So, You have 2 opportunities: search for proprietary SMART-watching software or use mdadm/dmraid.

Источник

smartctl questions (newbie) for Silicon Power 1TB caddy USB external HD

OS: MX Linux 19.4

USB external HDD: Silicon Power 1TB HDD (reported as ST1000LM024 HN-M101MBB, size: 931.51 GiB, block size: physical: 512 B logical: 512 B, rotation: 5400 rpm in Quick System Info in MX).

Problem: GSmartControl utility can’t recognize the HDD, checked /var/lib/smartmontools/drivedb/drivedb.h and there’s no entry for ST1000LM024.

In smartmontools site, in the FAQ, there are instructions to add missing drive to the db (My ATA/SATA drive is not in the smartctl/smartd database), followed the instructions to run a short test smartctl -t short /dev/sdb . Here’s the output:

When using hdparm command, got these output:

This is the output for $ sudo smartctl -i /dev/sdb

The output for sudo smartctl -a -T permissive /dev/sdb

Am I missing something? Why the test showed access denied in my external drive? I’m not that familiar with Linux, so thought it better to ask before doing something stupid. Can someone guide me in the right direction, please?
ps: the make of the caddy is Silicon Power, can’t find the model.

1 Answer 1

means your drive isn’t reacting properly to some SCSI commands.

With a drive that supports SMART properly, it should look like this:

suggest, you can add -T permissive or -T verypermissive to try to still get some output. Instead of starting a short test, do something like

to see all the SMART reports.

But SMART might just be broken for your drive.

SMART is a feature of the firmware on the harddrive. If the firmware of the harddrive isn’t programmed to provide this feature, then it’s just not available. Using a different Linux tool to access this won’t make a difference. Nor does a database table entry make a difference.

That said, sometimes USB-to-SATA bridges which are used in many USB enclosures don’t allow transmission of SMART commands. The way to test this is to open the enclosure, take the harddrive out, and directly connect the harddrive via SATA to the mainboard. If SMART works with that setup, then it’s the bridge chip. If it doesn’t, it’s the harddrive.

smartctl also has the -d option to select workarounds for a number of devices where the bridge or some other issue blocks the SMART commands. See man smartctl . But I wouldn’t recommend to use any of those unless you are reasonably sure that your hardware matches those devices.

Источник

How to get SMART on external drives

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

Edited 3 times, last by petermc ( Apr 2nd 2019 ).

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.

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

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

smartctl —health /dev/sde

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

Edited 4 times, last by petermc ( Apr 2nd 2019 ).

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

Edited once, last by tkaiser ( Apr 2nd 2019 ).

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

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.

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?

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

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

Final solution, find drive details,

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

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

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

Edited once, last by petermc ( Apr 2nd 2019 ).

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).

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

or -better- port armbianmonitor

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).

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.

omv 6.1.4-1 Shaitan | 64 bit | 6.1 proxmox kernel | plugins :: omvextrasorg 6.1.1 | kvm 6.2.7 | compose 6.5.1 | mergerfs 6.3.4 | zfs 6.0.12
omv-extras.org plugins source code and issue tracker — github

Please try ctrl-shift-R and read this before posting a question.

Please put your OMV system details in your signature.
Please don’t PM for support. Too many PMs!

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, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Specific Class, Driver=smsc95xx, 480M
|__ Port 3: Dev 4, If 0, Storage, Driver=usb-storage, 480M

@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 ?

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.

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.

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

Источник

Whenever I buy a new hdd I like to run a couple of scripts using smartctl to display the drive’s SMART data and to run the short and long drive self tests. I also check the SMART data every once in a while.

I’ve just received a new Seagate 5TB USB3 drive — model Backup Plus Portable STHP5000400. I’m using Mint 19 64 bit with the default version of smartmontools which is 7.0 — I don’t know how I’d upgrade to 7.1; however I have managed to download a more recent drivedb.h drive database (although it didn’t improve matters)

My script to display the SMART data calls (from root) smartctl -iA $DEVICE and the output from the command is :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

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.

So I tried smartctl -ia -T verypermissive and the output is :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, 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: Wed Jun 17 19:04:19 2020 BST
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

=== START OF READ SMART DATA SECTION ===

Finally I tried smartctl -iA -d scsi -T verypermissive and got :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor: Seagate
Product: BUP Portable
Revision: 0004
Compliance: SPC-4
User Capacity: 5,000,981,077,504 bytes [5.00 TB]
Logical block size: 512 bytes
Physical block size: 4096 bytes
Logical Unit id: 0x5000000000000001
Serial number: 00000000NAB76E03
Device type: disk
Local Time is: Wed Jun 17 19:07:46 2020 BST
SMART support is: Available — device has SMART capability.
SMART support is: Disabled
Temperature Warning: Disabled or Not Supported

=== START OF READ SMART DATA SECTION ===

Getting a bit closer but still not there by a long way. I thought it interesting that it said Smart was available but disabled.

Much against my better nature I decided to see what some Windows software would make of this disk so booted Windows 8.1

Firstly I ran Seatools for Windows v 1.4.0.4 which had been installed on May 2016. The drive appeared twice under two headings SAS-SCSI_FC and USB-1394. I was able to run a SMART check which said OK with no detail and also ran a short Drive Self Test — again OK. I noted it says SMART ENABLED.

Secondly I ran Passmark Disk Checker v 3.2 which had been installed on April 4 2016. Again it had no trouble with the drive and this time I was able to see the RAW SMART values — reassuringly critical items like Reallocated Sector Count were zero. Also said SMART supported Yes, SMART enabled Yes, SMART self-test supported Yes.

I tried to attach screen shots of these programs but couldn’t get it to work!

I wondered if possibly the Windows software had changed something in the drive but on reverting to Linux I found nothing had changed.

What I find surprising is that the Windows software I used is over five years old, much older than smartmontools v 7.0.

Anyway I guess I’ll boot into Windows 8.1 last thing tonight and leave it running a full drive self test overnight.

However, I would really like to get smartmontools to work with this drive and I’m prepared to put some effort into it if a more experienced person can point me in the right direction.

Many thanks if anyone can help.

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.

Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

IcIoNViO

Posts: 6
Joined: 2021-09-03 20:06

[SOLVED] Unable to spin down / suspend USB-attached disk

#1

Post

by IcIoNViO » 2021-09-03 20:30

On my headless Debian 11 machine, my USB-attached hard disk will not sleep and keeps spinning at low speed.
I’m using a minimal Debian installation.

The hard disk is a Seagate Basic 2.5in disk attached to a USB 3.0 port:
https://www.seagate.com/products/extern … ard-drive/

The machine is an HP t530:
https://www.parkytowers.me.uk/thin/hp/t530/

smartd is not installed so the answer posted here does not apply:
https://unix.stackexchange.com/a/476841

Code: Select all

$ cat /etc/smartd.conf
cat: /etc/smartd.conf: No such file or directory

It seems PM_RUNTIME=y needs to be set for USB saving to apply (https://wiki.gentoo.org/wiki/USB_Power_Saving).
I’ve checked and I can see it enabled.

Looking at the answers here, I attempted to autosuspend:
https://unix.stackexchange.com/a/166601
https://stackoverflow.com/a/12675749

Code: Select all

$ lsusb
Bus 001 Device 004: ID 103c:0610 GenesysLogic USB2.1 Hub
Bus 001 Device 003: ID 8087:0025 Intel Corp. Wireless-AC 9260 Bluetooth Adapter
Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. Root Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 0bc2:aa15 Seagate RSS LLC Basic
Bus 003 Device 002: ID 103c:8267 GenesysLogic USB3.1 Hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code: Select all

$ grep 0bc2 /sys/bus/usb/devices/*/idVendor  
/sys/bus/usb/devices/3-4.2/idVendor:0bc2

Enable autosuspend and change delay:

Code: Select all

echo "auto" > "/sys/bus/usb/devices/3-4.2/power/control"
echo "10" > "/sys/bus/usb/devices/3-4.2/power/autosuspend_delay_ms"

I waited a few minutes, but nothing happens.
The disk continues to spin.

I don’t see any meaningful activity in iotop.

I realise there are options though hdparm and PowerTOP.

There are also tlp and laptop-mode-tools, but they geared for laptops (e.g. controlling display brightness) and seem excessive for what I need, which is just to spin down a hard disk.

Thanks

Last edited by IcIoNViO on 2021-09-25 21:34, edited 1 time in total.




LE_746F6D617A7A69

Posts: 934
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 64 times

Re: Unable to spin down / suspend USB-attached disk

#4

Post

by LE_746F6D617A7A69 » 2021-09-08 20:52

IcIoNViO wrote: ↑2021-09-03 20:30
smartd is not installed so the answer posted here does not apply:

… and what’s the problem with installing it?

External USB drives are using SATA/USB bridge chips — some of them does not fully support the ATA/ATAPI standard, and that’s why some of «advanced» functionalities are not available.

Usually, the easiest way to verify whether the SATA/USB bridge chip is conforming to the standards is to try to read the SMART report, using the smartctl utility (the -dsat option may be required for unbranded/unknown chips)

Bill Gates: «(…) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system.»
The_full_story and Nothing_have_changed


IcIoNViO

Posts: 6
Joined: 2021-09-03 20:06

Re: Unable to spin down / suspend USB-attached disk

#5

Post

by IcIoNViO » 2021-09-08 22:36

Aki wrote: ↑2021-09-08 14:41

Have you verified if the usb disk supports dynamic suspend ? You can try the command:

where XXX is the device of your disk.

Thanks.

hdparm reports the following, which seems inconclusive?

Code: Select all

$ sudo hdparm -I /dev/sdb

/dev/sdb:

ATA device, with non-removable media
Standards:
        Likely used: 1
Configuration:
        Logical         max     current
        cylinders       0       0
        heads           0       0
        sectors/track   0       0
        --
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:           0 MBytes
        device size with M = 1000*1000:           0 MBytes
        cache/buffer size  = unknown
Capabilities:
        IORDY not likely
        Cannot perform double-word IO
        R/W multiple sector transfer: not supported
        DMA: not supported
        PIO: pio0

Last edited by IcIoNViO on 2021-09-08 22:39, edited 1 time in total.


IcIoNViO

Posts: 6
Joined: 2021-09-03 20:06

Re: Unable to spin down / suspend USB-attached disk

#6

Post

by IcIoNViO » 2021-09-08 22:38

LE_746F6D617A7A69 wrote: ↑2021-09-08 20:52

IcIoNViO wrote: ↑2021-09-03 20:30
smartd is not installed so the answer posted here does not apply:

… and what’s the problem with installing it?

External USB drives are using SATA/USB bridge chips — some of them does not fully support the ATA/ATAPI standard, and that’s why some of «advanced» functionalities are not available.

Usually, the easiest way to verify whether the SATA/USB bridge chip is conforming to the standards is to try to read the SMART report, using the smartctl utility (the -dsat option may be required for unbranded/unknown chips)

Here’s the output, which doesn’t seem very helpful.
Should I try connecting to a different USB port?

Code: Select all

$ sudo smartctl /dev/sdb -d sat
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-8-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

ATA device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information

Code: Select all

$ sudo smartctl /dev/sdb -a -T verypermissive
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-8-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, 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:    Wed Sep  8 23:37:42 2021 BST
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

=== START OF READ SMART DATA SECTION ===
SMART Status command failed: scsi error unsupported field in scsi command
SMART overall-health self-assessment test result: UNKNOWN!
SMART Status, Attributes and Thresholds cannot be read.

Read SMART Error Log failed: scsi error unsupported field in scsi command

Read SMART Self-test Log failed: scsi error unsupported field in scsi command

Selective Self-tests/Logging not supported


User avatar

ticojohn

Posts: 1261
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 18 times
Been thanked: 43 times

Re: Unable to spin down / suspend USB-attached disk

#7

Post

by ticojohn » 2021-09-08 23:36

I am NOT an expert, by any means, but I wonder if your drive is even working correctly. When I check an external USB drive using hdparm I get the following

Code: Select all

/dev/sdh:

ATA device, with non-removable media
	Model Number:       WDC WD3200BMVV-11SXZS1                  
	Serial Number:      WD-WXL1E61PHWK4
	Firmware Revision:  01.01A01
	Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6
Standards:
	Supported: 8 7 6 5 
	Likely used: 8
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:    16514064
	LBA    user addressable sectors:   268435455
	LBA48  user addressable sectors:   625142448
	Logical  Sector size:                   512 bytes
	Physical Sector size:                  4096 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      305245 MBytes
	device size with M = 1000*1000:      320072 MBytes (320 GB)
	cache/buffer size  = 8192 KBytes
	Nominal Media Rotation Rate: 5400

plus a whole lot more.

I am not irrational, I’m just quantum probabilistic.


Aki

Posts: 468
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 6 times
Been thanked: 60 times

Re: Unable to spin down / suspend USB-attached disk

#8

Post

by Aki » 2021-09-09 07:35

Hello,

IcIoNViO wrote: ↑2021-09-08 22:36
hdparm reports the following, which seems inconclusive?

Code: Select all

$ sudo hdparm -I /dev/sdb
/dev/sdb:
ATA device, with non-removable media
Standards:
        Likely used: 1
Configuration:
        Logical         max     current
        cylinders       0       0
        heads           0       0
        sectors/track   0       0
        --
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:           0 MBytes
        device size with M = 1000*1000:           0 MBytes
        cache/buffer size  = unknown
Capabilities:
        IORDY not likely
        Cannot perform double-word IO
        R/W multiple sector transfer: not supported
        DMA: not supported
        PIO: pio0

As user ticojohn pointed out, it looks like the disk is not correctly detected and a lot of information are missing in the output. Is the disk correctly connected and powered ? Can you give more information about your hardware configuration ? You could use the following commands with the external drive connected:

Code: Select all

script log.txt
su -c "apt install inxi"
inxi -v6 
exit

The output will be in log.txt file.

EDIT: for test purposes, I obtained your same output querying the empty cdrom drive:

Code: Select all

# hdparm -I /dev/cdrom 

/dev/cdrom:

ATA device, with non-removable media
Standards:
        Likely used: 1
Configuration:
        Logical         max     current
        cylinders       0       0
        heads           0       0
        sectors/track   0       0
        --
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:           0 MBytes
        device size with M = 1000*1000:           0 MBytes 
        cache/buffer size  = unknown
Capabilities:
        IORDY not likely
        Cannot perform double-word IO
        R/W multiple sector transfer: not supported
        DMA: not supported
        PIO: pio0 

You have probably queried the wrong device. Please send the information about hardware configuration anyway.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian — The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀


IcIoNViO

Posts: 6
Joined: 2021-09-03 20:06

Re: Unable to spin down / suspend USB-attached disk

#9

Post

by IcIoNViO » 2021-09-09 08:16

Thanks for your replies.

After further investigation, it turns out that for a number of Seagate enclosures, Linux disables SAT transfers when running in UAS mode.
That’s true in my case:

Code: Select all

$ lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
        |__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M

There is more information here, for anyone else looking, including possible fixes:
https://www.smartmontools.org/wiki/SAT-with-UAS-Linux
https://www.smartmontools.org/ticket/971
https://www.smartmontools.org/wiki/Supp … SB-Devices
https://askubuntu.com/questions/637450/ … hard-drive






Scar_UY

Posts: 1
Joined: 2021-09-30 23:09

Re: [SOLVED] Unable to spin down / suspend USB-attached disk

#14

Post

by Scar_UY » 2021-09-30 23:20

Hello IcIoNViO,

And Thank you!

I’ve been tinkering with linux on my own for the best part of the last 20 years, and while it usually takes me a ridiculous amount of time when I run into weird problems like the one you had, you clearly are far more proficient with linux than me for the way you understood, presented, and solved your problem, and what makes you an awesome person is that you posted everything here for others to find, like me, I ran in to the exact same problem, and the link you shared worked like magic.

More often than not, even after weeks googling and trying things, breaking and reinstalling and what not, I’m forced to abandon and find another way to do things when I run in to this kind of problems because my lack of deep (or sometimes even basic) knowledge of the inner workings of linux, this time is not one of those.

Sorry about the rant, I just wanted to give you some context so you understand how grateful I am for your contribution here.

Thank you!


Отвалился SMART на внешнем HDD

Есть внешний usb-винт Seagate Expansion STEA4000400 (опознаётся как ST4000LM016), подключен через хаб. Ещё пару недель всё было нормально и я спокойно мониторил температуру и reallocated sector count (коих было ноль). А сейчас куда-то всё успело отвалиться.

Хорошо, Disabled, бывает. Пытаюсь включить:

Попробуйте откатить ядро.

Далеко не все usb-sata адаптеры поддерживают SMART, может что-то отвалилось, попробуй другой. Проверь также на Windows, это может софтовая проблема, хоть и вряд ли.

консоль к винту и сброс смарта.

/1 и на уровне 1> команда N1

Эта процедура обнуляет данные SMART? То есть фактически можно затереть смарт и продать ушатанный дисп как почти новый?

обнуляет, но не все. пендинги/реаллокейты никуда не деваются к примеру (т.к. в дефект-листах). на некоторых моделях вроде время наработки тоже не сбрасывается.

Откат ядра до старого гарантированно рабочего или обновление до нового ничего не дали. К слову, у трёх других подключенных винтов SMART работает нормально

usb-sata адаптер встроен в заводскую коробку внешнего винта и я с ними ничего особенного не делал

Консоль к винту выглядит немножко перебором, этот совет я пожалуй отложу на крайний случай)

Откат ядра до старого гарантированно рабочего или обновление до нового ничего не дали.

А какие ядра из серии 4.14.x побывали в работе? Там были страшные регресс-баги с блочными устройствами.

Откатывался на 4.14.5, там у меня ещё всё работало если ничего не напутал. Топик создал на 4.14.8, вчера обновился до 4.14.9. Арч

Интересный факт: вин7 в виртуалбоксе прекрасно видит весь SMART, а линукс — ни в какую, хотя я с момента создания темы уже стопицот раз обновлялся и стопицот раз перезагружался.

Подозреваю, «консоль к винту» в таком случае ничего не изменит

Источник

Linux Mint Forums

Welcome to the Linux Mint forums!

[SOLVED] smartmontools doesn’t like my new hdd!

[SOLVED] smartmontools doesn’t like my new hdd!

Post by xGuy » Wed Jun 17, 2020 2:55 pm

Whenever I buy a new hdd I like to run a couple of scripts using smartctl to display the drive’s SMART data and to run the short and long drive self tests. I also check the SMART data every once in a while.

I’ve just received a new Seagate 5TB USB3 drive — model Backup Plus Portable STHP5000400. I’m using Mint 19 64 bit with the default version of smartmontools which is 7.0 — I don’t know how I’d upgrade to 7.1; however I have managed to download a more recent drivedb.h drive database (although it didn’t improve matters)

My script to display the SMART data calls (from root) smartctl -iA $DEVICE and the output from the command is :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

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.

So I tried smartctl -ia -T verypermissive and the output is :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, 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: Wed Jun 17 19:04:19 2020 BST
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

=== START OF READ SMART DATA SECTION ===

Finally I tried smartctl -iA -d scsi -T verypermissive and got :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor: Seagate
Product: BUP Portable
Revision: 0004
Compliance: SPC-4
User Capacity: 5,000,981,077,504 bytes [5.00 TB]
Logical block size: 512 bytes
Physical block size: 4096 bytes
Logical Unit id: 0x5000000000000001
Serial number: 00000000NAB76E03
Device type: disk
Local Time is: Wed Jun 17 19:07:46 2020 BST
SMART support is: Available — device has SMART capability.
SMART support is: Disabled
Temperature Warning: Disabled or Not Supported

=== START OF READ SMART DATA SECTION ===

Getting a bit closer but still not there by a long way. I thought it interesting that it said Smart was available but disabled.

Much against my better nature I decided to see what some Windows software would make of this disk so booted Windows 8.1

Firstly I ran Seatools for Windows v 1.4.0.4 which had been installed on May 2016. The drive appeared twice under two headings SAS-SCSI_FC and USB-1394. I was able to run a SMART check which said OK with no detail and also ran a short Drive Self Test — again OK. I noted it says SMART ENABLED.

Secondly I ran Passmark Disk Checker v 3.2 which had been installed on April 4 2016. Again it had no trouble with the drive and this time I was able to see the RAW SMART values — reassuringly critical items like Reallocated Sector Count were zero. Also said SMART supported Yes, SMART enabled Yes, SMART self-test supported Yes.

I tried to attach screen shots of these programs but couldn’t get it to work!

I wondered if possibly the Windows software had changed something in the drive but on reverting to Linux I found nothing had changed.

What I find surprising is that the Windows software I used is over five years old, much older than smartmontools v 7.0.

Anyway I guess I’ll boot into Windows 8.1 last thing tonight and leave it running a full drive self test overnight.

However, I would really like to get smartmontools to work with this drive and I’m prepared to put some effort into it if a more experienced person can point me in the right direction.

Many thanks if anyone can help.

Re: smartmontools doesn’t like my new hdd!

Post by smurphos » Wed Jun 17, 2020 3:25 pm

A lot of Seagate USB external drives are blacklisted by the kernel from providing SMART data due to allegedly buggy firmware.

Re: smartmontools doesn’t like my new hdd!

Post by xGuy » Wed Jun 17, 2020 6:25 pm

Many thanks for that extremely informative reply.

lsusb -t showed the HDD was using Driver=uas

/var/kern.log showed first the following messages

usb 4-1: new SuperSpeed USB device number 3 using xhci_hcd
New USB device found, idVendor=0bc2, idProduct=ac25
New USB device strings: Mfr=2, Product=3, SerialNumber=1
Product: BUP Portable
Manufacturer: Seagate
usbcore: registered new interface driver usb-storage

Then there was a flurry of log messages relating to the UFW firewall followed by :-

scsi host20: uas
usbcore: registered new interface driver uas
scsi 20:0:0:0: Direct-Access Seagate BUP Portable 0004 PQ: 0 ANSI: 6
sd 20:0:0:0: Attached scsi generic sg9 type 0
sd 20:0:0:0: [sdg] Spinning up disk

Anyway I decided to add the following line to my /etc/default/grub file :-

GRUB_CMDLINE_LINUX=»usb_storage.quirks=0bc2:ac25:u»

then called update-grub and rebooted.

Now the output from # smartctl -iA /dev/sdg is as follows :-

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-4.15.0-99-generic] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 2.5 5400
Device Model: ST5000LM000-2AN170
Serial Number: WCJ3CV8E
LU WWN Device Id: 5 000c50 0cf92be32
Firmware Version: 0001
User Capacity: 5,000,981,078,016 bytes [5.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5526 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Jun 17 23:05:04 2020 BST
SMART support is: Available — device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 066 066 006 Pre-fail Always — 4320088
3 Spin_Up_Time 0x0003 096 096 000 Pre-fail Always — 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always — 19
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always — 0
7 Seek_Error_Rate 0x000f 100 253 045 Pre-fail Always — 24235
9 Power_On_Hours 0x0032 100 100 000 Old_age Always — 4 (114 137 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always — 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always — 17
183 SATA_Downshift_Count 0x0032 100 100 000 Old_age Always — 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always — 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always — 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always — 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always — 0
190 Airflow_Temperature_Cel 0x0022 068 068 040 Old_age Always — 32 (Min/Max 29/32)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always — 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always — 25
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always — 85
194 Temperature_Celsius 0x0022 032 040 000 Old_age Always — 32 (0 22 0 0 0)
195 Hardware_ECC_Recovered 0x001a 066 066 000 Old_age Always — 4320088
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always — 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline — 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always — 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline — 0 (81 228 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline — 1967335
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline — 2352753
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always — 0

I was also able to run a short drive self test successfully — took about two minutes.

So as it’s past 23:00 here now I think I’ll take advantage of the night time and run the full self test under Windows overnight and then again under Mint 19 early tomorrow.

Can I prevail upon you a little more please?

I will fairly soon need another 5 GB USB HDD for this PC. Would I be better off with a Western Digital model? They are a bit more expensive but if it’s less hassle then I’ll go for a WD.

Also, I’m not sure what the effects of using the usb-storage driver rather than the uas driver on the Seagate might be. Are there performance, reliability, or (most serious of all) data integrity considerations to be aware of? Would it be wiser to revert to the default situation by commenting out that grub line and only using it when wanting to check the SMART on this particular drive?

Источник

Debian User Forums

[SOLVED] Unable to spin down / suspend USB-attached disk

[SOLVED] Unable to spin down / suspend USB-attached disk

#1 Post by IcIoNViO » 2021-09-03 20:30

On my headless Debian 11 machine, my USB-attached hard disk will not sleep and keeps spinning at low speed.
I’m using a minimal Debian installation.

The hard disk is a Seagate Basic 2.5in disk attached to a USB 3.0 port:
https://www.seagate.com/products/extern . ard-drive/

smartd is not installed so the answer posted here does not apply:
https://unix.stackexchange.com/a/476841

I waited a few minutes, but nothing happens.
The disk continues to spin.

I don’t see any meaningful activity in iotop.

I realise there are options though hdparm and PowerTOP.

There are also tlp and laptop-mode-tools, but they geared for laptops (e.g. controlling display brightness) and seem excessive for what I need, which is just to spin down a hard disk.

Re: Unable to spin down / suspend USB-attached disk

#2 Post by IcIoNViO » 2021-09-07 20:21

could someone helps with this?

Re: Unable to spin down / suspend USB-attached disk

#3 Post by Aki » 2021-09-08 14:41

IcIoNViO wrote: ↑ 2021-09-03 20:30 On my headless Debian 11 machine, my USB-attached hard disk will not sleep and keeps spinning at low speed.
I’m using a minimal Debian installation.

The hard disk is a Seagate Basic 2.5in disk attached to a USB 3.0 port:
https://www.seagate.com/products/extern . hard-drive

Re: Unable to spin down / suspend USB-attached disk

#4 Post by LE_746F6D617A7A69 » 2021-09-08 20:52

and what’s the problem with installing it?

External USB drives are using SATA/USB bridge chips — some of them does not fully support the ATA/ATAPI standard, and that’s why some of «advanced» functionalities are not available.

Usually, the easiest way to verify whether the SATA/USB bridge chip is conforming to the standards is to try to read the SMART report, using the smartctl utility (the -dsat option may be required for unbranded/unknown chips)

Re: Unable to spin down / suspend USB-attached disk

#5 Post by IcIoNViO » 2021-09-08 22:36

IcIoNViO wrote: ↑ 2021-09-03 20:30 On my headless Debian 11 machine, my USB-attached hard disk will not sleep and keeps spinning at low speed.
I’m using a minimal Debian installation.

The hard disk is a Seagate Basic 2.5in disk attached to a USB 3.0 port:
https://www.seagate.com/products/extern . hard-drive

hdparm reports the following, which seems inconclusive?

Re: Unable to spin down / suspend USB-attached disk

#6 Post by IcIoNViO » 2021-09-08 22:38

and what’s the problem with installing it?

External USB drives are using SATA/USB bridge chips — some of them does not fully support the ATA/ATAPI standard, and that’s why some of «advanced» functionalities are not available.

Usually, the easiest way to verify whether the SATA/USB bridge chip is conforming to the standards is to try to read the SMART report, using the smartctl utility (the -dsat option may be required for unbranded/unknown chips)

Re: Unable to spin down / suspend USB-attached disk

#7 Post by ticojohn » 2021-09-08 23:36

Re: Unable to spin down / suspend USB-attached disk

#8 Post by Aki » 2021-09-09 07:35

The output will be in log.txt file.

EDIT: for test purposes, I obtained your same output querying the empty cdrom drive:

Re: Unable to spin down / suspend USB-attached disk

#9 Post by IcIoNViO » 2021-09-09 08:16

Thanks for your replies.

After further investigation, it turns out that for a number of Seagate enclosures, Linux disables SAT transfers when running in UAS mode.
That’s true in my case:

Re: Unable to spin down / suspend USB-attached disk

#10 Post by Aki » 2021-09-09 08:35

Are you planning to reactivate (even if temporarily) the pass-through commands for the SAT (SCSI/ATA Translation, ANSI INCITS 431-2007) standard for your Seagate drive as shown in workaround B [1] ? If yes, you could try to query the disk and try to activate the suspend functionalities of the drive (if any).

Re: Unable to spin down / suspend USB-attached disk

#11 Post by LE_746F6D617A7A69 » 2021-09-09 21:00

Re: Unable to spin down / suspend USB-attached disk

#12 Post by IcIoNViO » 2021-09-25 21:33

Thanks for your replies.

After some experimenting, I managed to communicate with the drive.
Also, I did so without disabling UAS.

and the important bit is to omit the «u» at the end.
This disables NO_ATA_1X flag, but keeps the UAS functionality.

But that didn’t work.

The only thing that work was to set

To make this persist a reboot, I edited /etc/hdparm.conf:

Re: [SOLVED] Unable to spin down / suspend USB-attached disk

#13 Post by Aki » 2021-09-26 08:12

Thank you for the update: I’m happy you sorted it out.

As user LE_746F6D617A7A69 pointed out, it is better to adopt a cautionary approach with «quirks», but in your case it seems to work.

I did the same for a USB3 HDD disk enclosure with ASM1053e. The kernel patch that disabled SAT ATA PASS-THROUGH (in UAS mode) for the ASM1051 chipset is about 7 years old [1] and I seem to understand that some/most of ASM1053 chipset could work correctly anyway, so I gave it a try.

Re: [SOLVED] Unable to spin down / suspend USB-attached disk

#14 Post by Scar_UY » 2021-09-30 23:20

I’ve been tinkering with linux on my own for the best part of the last 20 years, and while it usually takes me a ridiculous amount of time when I run into weird problems like the one you had, you clearly are far more proficient with linux than me for the way you understood, presented, and solved your problem, and what makes you an awesome person is that you posted everything here for others to find, like me, I ran in to the exact same problem, and the link you shared worked like magic.

More often than not, even after weeks googling and trying things, breaking and reinstalling and what not, I’m forced to abandon and find another way to do things when I run in to this kind of problems because my lack of deep (or sometimes even basic) knowledge of the inner workings of linux, this time is not one of those.

Sorry about the rant, I just wanted to give you some context so you understand how grateful I am for your contribution here.

Источник

Понравилась статья? Поделить с друзьями:
  • React query error handling
  • React node sass error
  • React native the development server returned response error code 500
  • React native start error
  • React native android network error