How to fix ERROR_GEN_FAILURE (31)
Description
A device attached to the system is not functioning. This error means Windows sent a read or write request to a storage device and the device failed to complete it. During file transfers it is most common with USB flash drives, external hard drives, SD cards, phones and cameras connected over USB, and drives in USB enclosures or docks.
Causes
- Unstable USB connection — a loose cable, worn connector, unpowered hub, or front-panel port that briefly drops the connection during the transfer.
- Insufficient power — bus-powered external drives may not get enough power from some ports or hubs, especially during sustained writes.
- Failing storage media — bad sectors, worn-out flash memory, or a failing hard drive return errors when specific areas are accessed.
- Phone or camera (MTP) transfers — copying from an iPhone or Android device can fail if the device locks, switches USB mode, or converts files on the fly (for example HEIC to JPEG).
- USB power-saving — Windows suspends the USB port or device to save power in the middle of a transfer.
- Outdated or faulty drivers — USB controller, chipset, or storage drivers that do not handle the device correctly.
- Counterfeit or fake-capacity drives — cheap flash drives that report more capacity than they actually have fail when writing past their real size.
Solutions
-
Reconnect the device — unplug it, plug it directly into a USB port on the back of the computer (not a hub or front panel), and try a different cable if possible. Retry the transfer.
-
Use a powered hub or the drive's power adapter — for external hard drives, make sure they have enough power for long transfers.
-
Disable USB selective suspend — open Power Options → Change plan settings → Change advanced power settings → USB settings and set USB selective suspend to Disabled. In Device Manager, you can also uncheck Allow the computer to turn off this device to save power on each USB Root Hub.
-
Keep phones unlocked and set to file transfer — leave the phone unlocked during the copy. On iPhone, set Settings → Photos → Transfer to Mac or PC to Keep Originals to avoid on-the-fly conversion.
-
Check the drive for errors — run
chkdsk X: /f /rfrom an elevated Command Prompt (replace X with the drive letter). Use the manufacturer's diagnostic tool or check the drive's SMART status for signs of failure. -
Update drivers — in Device Manager, update or reinstall the drivers under Universal Serial Bus controllers and Disk drives, and install the latest chipset drivers from your PC manufacturer.
-
Copy what you can and replace the device — if the error keeps appearing on the same files, the media is probably failing. Copy the remaining data to a safe location and stop using the device.