Closed pymumu closed 4 years ago
The Pi 4 uses UAS as the disk transport, not USB mass-storage which is used on all previous models of Pi.
I have a Sabrent USB3.0 adapter which exhibits the issue - on a Pi 4 hdparm -y /dev/sda
returns the same error that you're seeing, but not on a Pi 3. hdparm -I /dev/sda
works in both cases, though.
In both cases for hdparm -y
, I see that hdparm issues a ATA pass-through command with various parameters set, then requests an IN transfer to check the result. In the UAS case, the SCSI sense response is "illegal command" whereas in the mass storage case the mass-storage ATA passthrough response has a nonzero error field and the endpoint STALLs.
The command is failing on both Pis, presumably because the device doesn't support the command, but the UAS case is noisier about it. In your case, it's probable that the pass-through isn't working with UAS but is with mass-storage.
Can you try the steps here and report back: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245931
After adding quirks to /boot/cmdline.txt, problem solved, the hard disk works very well so far.
Thanks.
The quirks added to /boot/cmdline.txt
root@raspberrypi:/home/pi# cat /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=d9b3f436-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles usb-storage.quirks=0bc2:231a:u
hdparm -I /dev/sda
command result
root@raspberrypi:/home/pi# hdparm -I /dev/sda
/dev/sda:
ATA device, with non-removable media
Model Number: ST4000LM024-2AN17V
Serial Number: WCK2PTAP
Firmware Revision: 0001
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Used: unknown (minor revision code 0x006d)
Supported: 10 9 8 7 6 5
Likely used: 10
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: 7814037168
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 3815447 MBytes
device size with M = 1000*1000: 4000787 MBytes (4000 GB)
cache/buffer size = unknown
Form Factor: 2.5 inch
Nominal Media Rotation Rate: 5526
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = ?
Advanced power management level: 254
Recommended acoustic management value: 208, current value: 208
DMA: mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5 udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
dmesg
log
[ 509.233313] usb 2-1: New USB device found, idVendor=0bc2, idProduct=231a, bcdDevice= 7.08
[ 509.233328] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 509.233341] usb 2-1: Product: Expansion
[ 509.233353] usb 2-1: Manufacturer: Seagate
[ 509.233365] usb 2-1: SerialNumber: NAA3GRTM
[ 509.236617] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[ 509.236738] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[ 509.236757] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 509.237819] usb-storage 2-1:1.0: Quirks match for vid 0bc2 pid 231a: 800000
[ 509.237953] scsi host0: usb-storage 2-1:1.0
[ 510.242582] scsi 0:0:0:0: Direct-Access Seagate Expansion 0708 PQ: 0 ANSI: 6
[ 510.243651] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 515.687671] sd 0:0:0:0: [sda] Very big device. Trying to use READ CAPACITY(16).
[ 515.688048] sd 0:0:0:0: [sda] 7814037167 512-byte logical blocks: (4.00 TB/3.64 TiB)
[ 515.688062] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 515.688813] sd 0:0:0:0: [sda] Write Protect is off
[ 515.688827] sd 0:0:0:0: [sda] Mode Sense: 47 00 00 08
[ 515.689545] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 515.808437] sda: sda1 sda2
[ 515.813176] sd 0:0:0:0: [sda] Attached SCSI disk
[ 517.042890] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
Closing as workaround implemented.
Describe the bug The
hdparm -I /dev/sda
is not working, similar harddisk command likehdparm -y /dev/sda
also fails.To reproduce hdparm -I /dev/sda hdparm -y /dev/sda hdparm -C /dev/sda
Expected behaviour Support set harddisk spin-down time. On pi3, all things works fine
Run same command on pi3 with same USB hard disk, everything works fine:
System
cat /etc/rpi-issue
)? Raspberry Pi reference 2019-09-26 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 80d486687ea77d31fc3fc13cf3a2f8b464e129be, stage5vcgencmd version
)? Sep 24 2019 17:34:30 Copyright (c) 2012 Broadcom version cd3add54955f8fa065b414d8fc07c525e7ddffc8 (clean) (release) (startuname -a
)? Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/LinuxLogs dmesg on PI4
same disk on pi3's dmsg log, this works fine
Additional context