Guide Fix Error Code 21 Windows Removing Device - Complete Solution
🚀 Quick Fix Summary
Error Type: Hardware Device Error
Error Code: Error Code 21
Common Causes: Device being removed, driver issues, USB connection problems, hardware conflicts, power management
Time to Fix: 15-30 minutes
Difficulty: Easy to Intermediate
Success Rate: 90% with proper method selection
The "Guide Fix Error Code 21 Windows Removing Device" is a Windows device management error that occurs when Windows detects that a hardware device is being removed or disconnected, even though the device is still physically connected. This error message typically appears in Device Manager as "Windows is removing this device (Code 21)" or "This device is being removed (Code 21)" when checking device properties, preventing the device from functioning properly and causing it to disappear from Windows Explorer or applications.
Error Code 21 specifically indicates that Windows is in the process of removing or has removed a device from the system, typically due to the device being unplugged, driver issues causing Windows to think the device was removed, USB connection problems causing intermittent disconnections, hardware conflicts causing Windows to remove one of the conflicting devices, or power management settings causing devices to be removed to save power. The error affects USB devices, external storage drives, printers, scanners, webcams, network adapters, and other peripherals on Windows 10, Windows 11, Windows 8.1, and Windows 7 systems.
This error is particularly frustrating because it can appear even when devices are properly connected, making it seem like a hardware failure when the issue is actually software-related. The error can occur suddenly after Windows updates, driver installations, or system restarts, and can affect devices that were previously working correctly. Common scenarios include systems where USB devices disconnect and reconnect repeatedly, systems where devices disappear from Device Manager, systems where external drives are not recognized, and systems where devices work intermittently.
Understanding that Error Code 21 can have multiple causes is crucial for effective resolution. The error typically stems from USB connection issues, driver problems causing Windows to incorrectly detect device removal, power management settings automatically removing devices, hardware conflicts between multiple devices, or Windows Update changes affecting device detection. This comprehensive guide provides five proven methods to resolve Error Code 21, including reconnecting and refreshing devices, updating and reinstalling drivers, disabling USB selective suspend, resolving hardware conflicts, and checking USB port and cable issues.
Understanding Error Code 21 - Windows Removing Device
Error Code 21 is a Windows device management error that indicates Windows is removing or has removed a device from the system. This error occurs when Windows detects device disconnection, even if the device is physically connected.
Where this error typically occurs:
- Device Manager - when viewing device properties
- USB devices - when external storage, printers, or other USB peripherals are connected
- External drives - when external hard drives or SSDs are connected
- Network adapters - when USB network adapters are used
- Audio devices - when USB audio devices are connected
Common error messages you might encounter:
- "Windows is removing this device (Code 21)"
- "This device is being removed (Code 21)"
- "Error Code 21 - Windows Removing Device"
- Device appears and disappears in Device Manager
- Device not recognized or not accessible
Why Error Code 21 occurs:
- USB connection issues: Loose USB connections or faulty USB ports causing disconnections
- Driver problems: Corrupted or incompatible drivers causing Windows to think device was removed
- USB selective suspend: Power management removing devices to save power
- Hardware conflicts: Multiple devices competing for same resources
- Faulty USB cable: Damaged or low-quality USB cable causing connection problems
- USB port issues: Faulty or damaged USB ports causing intermittent connections
- Windows Update changes: Updates modifying device detection or drivers
Method 1: Reconnect and Refresh Device (Quick Fix)
This method addresses the most common cause of Error Code 21: connection issues. Reconnecting the device and refreshing Device Manager often resolves temporary connection problems.
- Disconnect the device:
- Safely remove the device if it's a storage device
- Unplug USB device from computer
- Wait 10-15 seconds
- Reconnect the device:
- Plug device into same USB port
- Or try a different USB port
- Wait for Windows to detect device
- Refresh Device Manager:
- Open Device Manager
- Click Action menu → Scan for hardware changes
- Or press F5 to refresh
- Check if device appears without Error Code 21
- Check device status:
- If device appears, right-click → Properties
- Check "Device status" - should show "This device is working properly"
- If Error Code 21 persists, proceed to Method 2
Why this works: Temporary connection issues can cause Windows to detect device removal incorrectly. Reconnecting the device and refreshing Device Manager forces Windows to re-detect the device, resolving temporary Error Code 21 issues.
Method 2: Update or Reinstall Device Drivers
Corrupted or incompatible drivers can cause Windows to incorrectly detect device removal. Updating or reinstalling drivers resolves driver-related Error Code 21 issues.
- Open Device Manager:
- Press Windows + X → Device Manager
- Locate device showing Error Code 21 (may be under "Other devices" or device category)
- Update driver automatically:
- Right-click device → Update driver
- Select Search automatically for drivers
- Wait for Windows to search and install updated driver
- Restart if prompted
- Reinstall driver if update doesn't help:
- Right-click device → Uninstall device
- Check "Delete the driver software for this device" if available
- Click Uninstall
- Disconnect and reconnect device
- Windows will automatically reinstall driver
- Download driver from manufacturer:
- If automatic driver installation fails, visit manufacturer's website
- Download latest driver for your device model
- Install driver as Administrator
- Restart computer
When to use this method: Use Method 2 when reconnecting device doesn't resolve Error Code 21, when device appears with yellow warning in Device Manager, or when error persists after reconnection.
Method 3: Disable USB Selective Suspend
USB power management can cause devices to be removed automatically, triggering Error Code 21. Disabling USB selective suspend prevents automatic device removal.
- Open Power Options:
- Press Windows + R, type
powercfg.cpl, press Enter - Or Settings → System → Power & sleep → Additional power settings
- Press Windows + R, type
- Change power plan settings:
- Click Change plan settings next to active power plan
- Click Change advanced power settings
- Disable USB selective suspend:
- Expand USB settings → USB selective suspend setting
- Set both On battery and Plugged in to Disabled
- Click Apply → OK
- Disable USB power management in Device Manager:
- Open Device Manager
- Expand Universal Serial Bus controllers
- Right-click each USB Root Hub → Properties
- Go to Power Management tab
- Uncheck Allow the computer to turn off this device to save power
- Click OK for each USB Root Hub
- Restart computer:
- Restart to apply changes
- After restart, reconnect device
- Check if Error Code 21 is resolved
Why this works: USB selective suspend automatically removes USB devices to save power, causing Error Code 21. Disabling this feature prevents automatic device removal, keeping devices connected and accessible.
Method 4: Check USB Port and Cable Issues
Faulty USB ports or cables can cause intermittent connections, triggering Error Code 21. This method identifies and resolves physical connection problems.
- Try different USB port:
- Unplug device from current USB port
- Plug into different USB port (preferably USB 3.0 if available)
- Check if device is recognized
- If device works in different port, original port may be faulty
- Try different USB cable:
- If device uses removable USB cable, try different cable
- Use high-quality USB cable (avoid cheap or damaged cables)
- Check cable for physical damage
- If device works with different cable, original cable is faulty
- Check USB port power:
- Some devices require more power than USB port can provide
- Try USB port on different USB controller
- Or use powered USB hub for high-power devices
- Check if device requires external power supply
- Clean USB port and connector:
- Power off computer
- Use compressed air to clean USB port
- Clean device USB connector with isopropyl alcohol
- Ensure connectors are dry before reconnecting
- Test on another computer:
- Connect device to another computer
- If device works on other computer, issue is with your computer's USB ports
- If device doesn't work on other computer, device hardware may be faulty
When to use this method: Use Method 4 when Error Code 21 appears intermittently, when device works sometimes but not others, or when physical connection issues are suspected.
Method 5: Resolve Hardware Conflicts
Hardware conflicts can cause Windows to remove devices, triggering Error Code 21. Resolving conflicts restores device functionality.
- Check for conflicts in Device Manager:
- Open Device Manager
- Right-click device with Error Code 21 → Properties
- Go to Resources tab
- Check "Conflicting device list" for conflicts
- Disable conflicting devices temporarily:
- If conflicts found, disable conflicting device temporarily
- Try enabling device with Error Code 21
- If Code 21 resolves, conflict is confirmed
- Change resource settings:
- In device Properties → Resources tab
- Uncheck Use automatic settings
- Select different resource setting
- Click Change Setting and assign different values
- Click OK and restart if prompted
- Update conflicting device drivers:
- Update drivers for conflicting devices
- Newer drivers may resolve resource conflicts
- Restart computer after driver updates
Why this works: Hardware conflicts cause Windows to remove one of the conflicting devices to prevent system instability. Resolving conflicts by changing resource settings or updating drivers allows all devices to function properly.
💡 Pro Tip: Prevent Error Code 21
Use quality USB cables: Use high-quality USB cables to prevent connection issues. Keep drivers updated: Regularly update device drivers from manufacturer websites. Disable USB selective suspend: Disable USB power management to prevent automatic device removal. Check USB ports: Regularly check USB ports for damage or debris. Use powered USB hubs: Use powered USB hubs for high-power devices. Safely remove devices: Always use "Safely Remove Hardware" before disconnecting storage devices.
Additional Troubleshooting Steps
Run Hardware Troubleshooter
Windows includes a hardware troubleshooter that can detect and fix device issues. Open Settings → Update & Security → Troubleshoot → Hardware and Devices → Run the troubleshooter.
Check Windows Event Viewer
Event Viewer can provide details about Error Code 21. Open Event Viewer (eventvwr.msc), check Windows Logs → System for device-related errors around the time Error Code 21 appeared.
Update USB Controller Drivers
Outdated USB controller drivers can cause device detection issues. Update USB controller drivers in Device Manager: Expand "Universal Serial Bus controllers", update each USB controller driver.
Prevention Strategies
- Use quality USB cables: Use high-quality USB cables to prevent connection issues
- Keep drivers updated: Regularly update device drivers from manufacturer websites
- Disable USB selective suspend: Disable USB power management to prevent automatic device removal
- Check USB ports: Regularly check USB ports for damage or debris
- Use powered USB hubs: Use powered USB hubs for high-power devices
- Safely remove devices: Always use "Safely Remove Hardware" before disconnecting storage devices
- Avoid USB port overload: Don't connect too many high-power devices to same USB controller
When to Seek Professional Help
If all methods fail to resolve Error Code 21, consider these scenarios:
- Hardware failure: If device hardware is failing, professional repair or replacement may be needed
- USB controller failure: If USB ports are physically damaged, motherboard repair may be needed
- Persistent errors: If Error Code 21 persists after all methods, deeper system issues may require professional diagnostics
- Enterprise environments: In business environments, consult IT support before attempting advanced repairs
Frequently Asked Questions
Q: Why does my USB device keep showing Error Code 21?
A: Repeated Error Code 21 usually indicates USB connection issues (faulty cable or port), USB power management removing the device, or driver problems. Try different USB port and cable, disable USB selective suspend, and update device drivers.
Q: Can Error Code 21 damage my device?
A: Error Code 21 itself doesn't damage devices, but the underlying causes (faulty USB ports, power issues) can potentially damage devices. Resolve Error Code 21 promptly to prevent potential hardware damage.
Q: Will updating Windows fix Error Code 21?
A: Sometimes yes. Windows updates often include USB and device driver improvements. However, updates can also cause Error Code 21 if they change device detection. Always update device drivers separately after Windows updates.
Q: Why does Error Code 21 appear only sometimes?
A: Intermittent Error Code 21 usually indicates connection issues (loose cable, faulty port), USB power management, or driver instability. Check physical connections, disable USB selective suspend, and update drivers.
Q: Can I prevent Error Code 21 from happening?
A: Yes, prevent Error Code 21 by using quality USB cables, keeping drivers updated, disabling USB selective suspend, checking USB ports regularly, and safely removing devices before disconnecting.