0

I'm getting the following error message when running hdparm -S on my external USB hard drive:

SG_IO: bad/missing sense data

Where is this sense data stored on the hard drive? I never encountered this error before, so I'm assuming something on the drive went corrupt.

2
  • 1
    Here is a good explanation of the issue you're having:Hard Drive error: bad/missing sense data
    – galoget
    Jan 31, 2018 at 4:24
  • @galoget That answer makes it seem it's a hardware issue ("drive controller doesn't support that method of enquiry, not all usb sata chipsets are created equal"). As I said in my question, hdparm -S worked before with the hard drive, but only now does it return the "SG_IO: bad/missing sense data". Did my hardware go bad?
    – Geremia
    Jan 31, 2018 at 16:03

2 Answers 2

2

hdparm is communicating with the driver controller firmware. It is requesting the sensor data from there. Here it might be that the controller/firmware does not support this command/operation or the tool is not the right for your controller/firmware.

If interested in more background information and details you may follow up at Linux SCSI Generic (sg) Driver, Python-SCSI or t10.org.

1
  • I did encounter the issue after upgrading my Linux kernel (I think to 4.14.14 or 4.14.15), so maybe it is the sg driver that changed.
    – Geremia
    Jan 31, 2018 at 16:05
0

The issue was that I needed to use:

sdparm -rs SCT=600 /dev/my_disk
sdparm -rC stop /dev/my_disk

instead of

hdparm -S 12 /dev/my_disk
hdparm -y /dev/my_disk

respectively.

(courtesy this table of sdparm's equivalents of hdparm commands)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.