Version 2 (modified by 5 years ago) ( diff ) | ,
---|
SAT with UAS under Linux
Overview
As mentioned on the USB devices and smartmontools page, in certain situations the Linux "uas" driver disables SAT transfers, which prevents smartmontools
(and other tools, e.g. hdparm
) from communicating properly with the attached SATA device. See related tickets for examples.
This is because the Linux kernel rejects SAT ATA pass-through commands for certain devices with broken pass-through support. This depends on Kernel version and may include all Seagate enclosures, Initio INIC-3069 and VIA VL711.
Technical Details
The problem is that certain USB-SATA-bridge chipsets do not properly pass SAT commands on to the SATA device when running in UAS mode, and to work around this problem Linux automatically enables the NO_ATA_1X flag for those chipsets. This turns off SAT passthrough... which in turn means that smartmontools is prevented from communicating with the device.
For many of these chipsets, SAT passthrough works correctly is the old BOT (usb-storage
driver) mode, and so smartmontools may suddenly stop working when the kernel is upgraded to a version which supports UAS, or from one which did did not apply the flag for that device to a newer kernel which does.
For more information on the usb-storage flags, search for the 'usb-storage.quirks' entry in the Kernel Parameters Documentation.
The detailed selection logic used by the kernel to decide which devices get this flag can be found in the uas_use_uas_driver()
function in the drivers/usb/storage/uas-detect.h combined with the list of entries found in the drivers/usb/storage/unusual_uas.h
file. (As far as smartmontools/SAT passthrough is concerned, only the NO_ATA_1X flag is significant.)
There doesn't seem to be a definitive way to confirm that the NO_ATA_1X flag is in fact in effect for a particular device, but if it is the symptom will be that commands which rely on SAT show invalid data, e.g.
# smartctl -d sat -a /dev/sdb smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-33-generic] (local build) Copyright (C) 2002-16, 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. # smartctl -d sat -T permissive -a /dev/sdb smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-33-generic] (local build) Copyright (C) 2002-16, 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: Mon Aug 27 20:44:01 2018 CEST 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
or
# hdparm -I /dev/sdc /dev/sdc: SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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