Hard Drive Error 'Invalid class name' – Real Fix That Works
This error means Windows can't read the drive's class descriptor. It's usually a driver registry corruption. Here's the quick fix and why it happens.
Quick answer
Open Device Manager, uninstall the drive under Disk drives, reboot. That clears the bad class descriptor. If it returns, you'll need to edit the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\disk\Enum and delete the offending value.
Why this happens
I've seen this error maybe two dozen times over the years. It's almost always on a secondary drive—internal SATA or external USB—that Windows suddenly can't read. The error shows up in Device Manager or Disk Management as 'Invalid class name' next to the drive. It's not a physical failure, which is the good news. The bad news is it's a Windows driver descriptor corruption. The drive's class GUID (the unique identifier that tells Windows what kind of device it is) gets scrambled in the registry. This usually happens after a bad driver update, a power failure during boot, or a USB controller hiccup that corrupts the device tree. Last week I had a client whose external Seagate backup drive showed this error after their cat knocked the tower over during a Windows update. The drive came right back after the fix below. But if you ignore it, Windows might eventually bluescreen with a DRIVER_IRQL_NOT_LESS_OR_EQUAL related to disk drivers.
Fix steps
- Check Disk Management first. Press Win + X, select Disk Management. If the drive shows as 'Unknown' or 'Not Initialized' with an error, proceed.
- Open Device Manager – right-click Start, select Device Manager.
- Expand Disk drives – look for the drive with a yellow exclamation or the error text 'Invalid class name' in its properties.
- Uninstall the driver – right-click the drive, select 'Uninstall device'. Check 'Delete the driver software for this device' if it appears (not always).
- Reboot – Windows will reinstall the correct class driver on restart. The drive should now appear normally.
- If still broken – open Registry Editor (
regedit). Navigate toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\disk\Enum. Look for a subkey with your drive's vendor ID (like 'WDC' for Western Digital, or 'Seagate'). Delete the entire subkey for that drive. Then repeat steps 2-5.
Alternative fixes if that doesn't work
Sometimes the registry fix alone doesn't stick because Windows caches the bad descriptor. Here's Plan B:
- Use the diskpart clean command – this wipes the drive's partition table, so only do it if you don't need the data or you've backed it up. In Command Prompt (Admin), run
diskpart, thenlist disk,select disk X(your problematic disk),clean, then format it fresh. But this is drastic—only if you're sure you can lose the data. - Update the ATA/SATA controller driver – in Device Manager, expand 'Storage controllers', find your SATA controller (like 'Standard SATA AHCI Controller'), right-click, 'Update driver' > 'Browse my computer' > 'Let me pick' > choose the Microsoft-provided driver. This can fix the class registration without touching data.
- Check for third-party antivirus – I've seen Avast and McAfee block disk class changes. Temporarily disable the AV, reboot, see if the drive comes back. If it does, uninstall that AV permanently.
Prevention tip
This error comes back if you're unlucky with bad driver updates. To stop it: set Windows Update to defer driver updates. Go to System > About > Advanced system settings > Hardware tab > Device Installation Settings. Select 'No (your device might not work as expected)' to prevent Windows from automatically fetching driver updates that can corrupt the class descriptor. I've done this for every client since 2020 and haven't seen this error recur. Also, if you're using external drives, always safely eject them—don't yank the USB cable. Bad USB removal is a common trigger for this registry corruption.
Had a client last month whose entire print queue died because of this error—turns out the weird 'Invalid class name' on the internal SSD was also messing up the printer driver stack. Fixed the drive, fixed the printer. That's how Windows rolls sometimes.
Was this solution helpful?