User avatar
HawaiianPi
Posts: 7640
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

hdparm, HDIO_DRIVE_CMD(identify) failed: Invalid argument

Thu Dec 19, 2019 11:13 am

Why does hdparm generate this error when testing SD cards in Buster?

Pi 3B+ with fresh Buster Lite install (no updates):
pi@raspberrypi:~ $ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
Timing cached reads: 1420 MB in 2.00 seconds = 709.78 MB/sec
HDIO_DRIVE_CMD(identify) failed: Invalid argument
Timing buffered disk reads: 68 MB in 3.02 seconds = 22.55 MB/sec

Happens in direct mode as well...

pi@raspberrypi:~ $ sudo hdparm -t --direct /dev/mmcblk0

/dev/mmcblk0:
HDIO_DRIVE_CMD(identify) failed: Invalid argument
Timing O_DIRECT disk reads: 68 MB in 3.07 seconds = 22.18 MB/sec


And on the Pi 4B with fully upgraded Raspbian too...
tim@RaspberryPi4B2:~ $ sudo hdparm -t --direct /dev/mmcblk0

/dev/mmcblk0:
HDIO_DRIVE_CMD(identify) failed: Invalid argument
Timing O_DIRECT disk reads: 122 MB in 3.03 seconds = 40.23 MB/sec

Doesn't happen when testing USB-SSD.

tim@RaspberryPi4B2:~ $ sudo hdparm -t --direct /dev/sda

/dev/sda:
Timing O_DIRECT disk reads: 974 MB in 3.00 seconds = 324.19 MB/sec


Never saw this error in Jessie or Stretch. Image
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

amcdonley
Posts: 207
Joined: Mon Jan 26, 2015 5:56 pm
Location: Florida, USA

Re: hdparm, HDIO_DRIVE_CMD(identify) failed: Invalid argument

Sun Aug 09, 2020 1:26 pm

Aug 2020 - still get this error msg, SD card speed is output ok.

Can't see a way to avoid the error msg.

trejan
Posts: 5527
Joined: Tue Jul 02, 2019 2:28 pm

Re: hdparm, HDIO_DRIVE_CMD(identify) failed: Invalid argument

Sun Aug 09, 2020 2:11 pm

Ignore that error. hdparm is designed for HDs and assumes the device will support all of the SCSI/ATA commands such as IDENTIFY DRIVE. The SD interface is completely different and doesn't have this command so gives that error. It is harmless.

Looking at the hdparm source, it is trying to work out the size of the drive so it can adjust the amount of data it reads. Larger drive = more data read.

Return to “Troubleshooting”