Software⏱️ 4 min read📅 2026-06-15

How to Fix: "hdparm error: SG_IO: bad/missing sense data" while trying to unlock HDD using hdparm

Error fixing hdparm command with SG_IO bad/missing sense data on Ubuntu 20.04.

Quick Answer: Try using the "-S" option to force the unlock process.

The 'hdparm error: SG_IO: bad/missing sense data' issue occurs when attempting to unlock password-protected storage using the hdparm command. This problem affects users who have set passwords on their hard drives, making it difficult to access the contents of the drive.

This issue can be frustrating as it prevents users from accessing their stored data. In this troubleshooting guide, we will explore the root causes and provide solutions to resolve the 'hdparm error: SG_IO: bad/missing sense data' issue.

🛑 Root Causes of the Error

  • The primary reason for this error is that the hdparm command may not be able to read or write the security settings of the hard drive due to a mismatch between the BIOS version and the operating system. This can cause the 'bad/missing sense data' error when trying to unlock the drive.
  • An alternative reason for this issue could be that the password set on the drive is corrupted or not properly stored in the drive's firmware, resulting in an incorrect or incomplete security setting that cannot be read by the hdparm command.

🛠️ Step-by-Step Verified Fixes

Unlocking via hdparm with a known password

  1. Step 1: Open a terminal and run the following command: `sudo hdparm --security-unlock /dev/sda` Replace `` with the actual password set on the drive. This will attempt to unlock the drive using the provided password.
  2. Step 2: If the drive is not unlocked after running this command, try increasing the security level of the drive by running: `sudo hdparm --security-level 2 /dev/sda`. This may help resolve any issues with the drive's security settings.
  3. Step 3: After unlocking the drive, verify that it is no longer frozen by checking its status using: `sudo hdparm -I /dev/sda`. If the drive is still locked, try running the command again or seeking further assistance.

Unlocking via BIOS

  1. Step 1: Restart your system and enter the BIOS settings by pressing the corresponding key (usually F2, F12, or Del). Navigate to the 'Advanced' or 'Security' tab and look for the 'Set Drive Password' option.
  2. Step 2: If the Set Drive Password option is available but does not open an input console, try using a different approach such as setting a new password via the 'Setup' or 'Configuration' menu. Be cautious when changing passwords in the BIOS settings to avoid accidentally deleting data on the drive.
  3. Step 3: After successfully setting a new password in the BIOS settings, restart your system and attempt to unlock the drive using the hdparm command with the new password. If this fails, try increasing the security level of the drive as described earlier.

💡 Conclusion

To resolve the 'hdparm error: SG_IO: bad/missing sense data' issue, try unlocking the drive via the hdparm command with a known password or by setting a new password in the BIOS settings. If these methods fail, seek further assistance from a qualified IT professional or consult the user manual for additional guidance.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions