Device Manager Codes

Code 21 — A Device That Is Halfway Out the Door

A brief explainer of the "removal pending" state and the safest way to clear it.

A State, Not a Failure

Code 21 is a transitional message — the operating system is in the middle of unloading a device but has not finished. Most of the time you will only see it for a moment after a driver uninstall or a hot-swap.

If the message persists, something has held a reference to the device — usually a background service that has not yet released its handle. Until that handle is freed, the operating system cannot complete the removal.

Hardware ports

How to Encourage a Stuck Removal to Complete

Open the Services panel and look for entries related to the device family — print spoolers, audio engines, Vpn services, virtual disk providers. Stopping the relevant service usually releases the handle and lets the removal finish.

If you cannot identify which service is holding things up, a restart is always safe. The next boot loads a fresh state with no pending removals.

Reviewing service list

When Code 21 Means a Hardware Issue

A device that shows code 21 every time and never finishes removal can indicate a flaky cable or port — the system keeps re-detecting it during the unload, which restarts the cycle. Try a different port or cable to see if the loop stops.

For internal devices, opening the case and reseating the card breaks the loop and lets the next boot start fresh.

Calm reading at desk

Browse More PrintSoftDriver Reads

Plain-English explainers, fix walkthroughs, and concept articles for every part of your system.