hdparm -I /dev/sda crashes device
Brought to you by:
ideguy
I am using Debian 10 "Buster"
# hdparm -V
hdparm v9.58
# uname -v
#1 SMP Debian 4.19.28-2 (2019-03-15)
When I issue the command
hdparm -I /dev/sda
I get
ATA device, with non-removable media
Model Number: 2.5" SATA SSD 3SE
Serial Number: 20140430AA0000000263
Firmware Revision: S130710
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
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: 31277232
LBA48 user addressable sectors: 31277232
Then after about 30 seconds I get kernel messages
[ 106.761031] ata1.01: revalidatin failed (errno=-5)
[ 129.285000] ata1.01: revalidatin failed (errno=-5)
[ 173.316994] ata1.01: revalidatin failed (errno=-5)
SG_IO: bad/missing sense data, sb[]: [ 185.648280]: print_req_error: I/O error, dev sda, sector 2048
... more Buffer I/O error and print_req_error ...
[ 185.625550] Aborting journal on device sda1-8
... more Buffer I/O error and print_req_error ...
[ 185.652707] Ext4-fs (sda1): previous I/O error to superblock detected
... more Buffer I/O error and print_req_error ...
[ 185.652840] JDB2: Error -5 detected when updating journal superblock for sda1-8
[ 185.653050] Ext4-fs error (device sda1): ext4_journal_check_start:61: Detected aborted journal
[ 185.653052] Ext4-fs (sda1): Remounting file system read-only
... more Buffer I/O error and print_req_error ...
[ 185.653096] Ext4-fs (sda1): I/O error while writing superblock
... more Buffer I/O error and print_req_error ...
70 00 05 00 00 00 00 0a 00 40 50 00 21 04 00 ... 00
Logical Sector size: 512 bytes
... more hdparm information ...
Checksum correct.
Afterwards the system is unusable. I only can halt it (with magic SysRq). Restart works fine.
The problem was reproducible with another SSD of the same type, and with the SSD in another computer.
The command
hdparm --Istdout /dev/sda | hdparm --Istdin
gives
ATA device, with non-removable media
Model Number: 2.5" SATA SSD 3SE
Serial Number: 20140430AA0000000263
Firmware Revision: S130710
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
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: 31277232
LBA48 user addressable sectors: 31277232
Logical Sector size: 512 bytes
and throws an error
HDIO_DRIVE_CMD(identify) failed: Bad file descriptor
to stdout.
With hdparm version 9.51 (installed from the package from Debian 9) the command hdparm -I /dev/sda work hdparm --Istdout /dev/sda | hdparm --Istdin but have different outputs.
I downloaded and compiled versions 9.52 - 9.57 and tested the two commands
With version 9.56 both commands give the same output (hdparm -I with an additional line /dev/sda:).
With versions 9.52 - 9.55 the "-I" calls give the same output als the 9.56 versions.
The "--Istout ... | --Istdin" versions give inplausible information:
Same does the version 9.51 from Debian 9.
Version 9.57 behaves like the originally used version 9.58.
The error still exists in versoin 9.62.
Kernel (libata) bug, not hdparm.