Hard Drive Error: Invalid class name – 3 Fixes
The 'Invalid class name' error happens when Windows can't read your hard drive's device class. We'll start with the fix that works 80% of the time.
1. The Registry Class GUID is Missing or Corrupted (Most Common)
This is the fix I've used on maybe 200 machines over the years. The 'Invalid class name' error pops up in Device Manager under your hard drive's Properties > General tab. The device status reads something like: Windows cannot load the device driver for this hardware because the device instance's class is not configured properly. (Code 39) - Invalid class name.
What's actually happening: Windows looks up your hard drive's class GUID (a unique identifier for disk drives) in the registry, and that key is either missing, empty, or has bad permissions. The fix is straightforward.
- Press Windows Key + R, type
regedit, and hit Enter. - Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e967-e325-11ce-bfc1-08002be10318} - Right-click the
{4d36e967-e325-11ce-bfc1-08002be10318}key in the left pane and choose Permissions. - Make sure SYSTEM and Administrators both have Full Control checked. If not, click each user, check Full Control under Allow, and click OK.
- Now, in the right pane, look for a string value called Class. Its data should be
DiskDrive. If it's missing, right-click in the right pane, choose New > String Value, name it Class, and set its value toDiskDrive. - Also check for a REG_SZ value called ClassGUID. It should be
{4d36e967-e325-11ce-bfc1-08002be10318}. If it's missing or wrong, create or edit it to match that GUID exactly. - Close Regedit. Restart your PC.
After boot, go back to Device Manager and check your hard drive. The error should be gone. If it's still there, move to the next fix.
2. The Disk Drive Driver Itself is Bad
Sometimes the class key is fine, but the driver that Windows loaded for your hard drive is corrupted or incompatible. This happens a lot after a failed Windows Update or a sudden power loss during a driver install. I've seen it on both SATA SSDs and NVMe drives.
- Open Device Manager (right-click Start > Device Manager).
- Expand Disk drives. You'll see your hard drive listed, probably with a yellow exclamation mark.
- Right-click that drive and choose Uninstall device. Windows will warn you. Click Uninstall.
- Do NOT restart yet. In Device Manager, click the Action menu at the top, then Scan for hardware changes.
- Windows will redetect the drive and reinstall the default driver automatically. You'll see it appear back in Disk drives without the error.
- Restart your PC to make sure the driver stays loaded.
This works because uninstalling clears out whatever junk got attached to the driver's settings. The fresh reinstall forces Windows to rebuild the class registry entry from scratch. I've seen this fix the issue immediately after the scan completes.
3. The Underlying Storage Controller Has a Class Problem
If the first two fixes didn't help, the issue might not be your specific hard drive — it could be the storage controller it's connected to. The controller (like the Intel SATA AHCI controller or a standard NVMe controller) also has a class GUID in the registry. If that gets corrupted, all drives downstream show the 'Invalid class name' error.
Here's how I check and fix this:
- In Device Manager, expand Storage controllers. You'll see entries like Standard NVM Express Controller or Intel(R) 6th Gen Core Processor Family Platform I/O SATA AHCI Controller.
- Look for any that have a yellow exclamation mark or error. Right-click it and choose Properties. Check if it shows the same 'Invalid class name' error.
- If it does, you'll need to fix its registry class key the same way you did in step 1. The GUID for storage controllers is:
{4d36e96a-e325-11ce-bfc1-08002be10318} - Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e96a-e325-11ce-bfc1-08002be10318}in Regedit. - Check that the Class value is
Hdc(stands for 'Hardware Device Controller' — yes, that's the name) and the ClassGUID matches the GUID above. - Also check the Permissions on this key — same as before, SYSTEM and Administrators must have Full Control.
- After fixing, restart the PC and check both the controller and the drive.
One thing I've learned: sometimes the controller's class key is fine, but permissions got locked down by a security tool or a third-party driver update. That's why fixing permissions is the real fix, not just checking values.
Quick-Reference Summary
| Cause | Symptoms | Fix | Success Rate |
|---|---|---|---|
| Missing or corrupted DiskDrive class GUID | Error on hard drive only, controller OK | Fix registry key {4d36e967-e325-11ce-bfc1-08002be10318} – restore Class value and permissions |
80% |
| Bad disk drive driver | Error on hard drive, driver rollback fails | Uninstall drive in Device Manager, then scan for hardware changes | 15% |
| Corrupted storage controller class GUID | Error on both controller and drive | Fix registry key {4d36e96a-e325-11ce-bfc1-08002be10318} for Hdc class |
5% |
If none of these work, you're probably dealing with a failing drive or a bad motherboard SATA port. Try a different SATA cable or port, or test the drive in another PC. But in my experience, 9 out of 10 times it's the registry class key being empty or permissions being stripped. Start there, and you'll save yourself a lot of headache.
Was this solution helpful?