| Previous | Next |
| ERROR_WRITE_PROTECT | ERROR_NOT_READY |
ERROR_BAD_UNIT
The selected device unit is unavailable
ERROR_BAD_UNIT means the request refers to a device number or logical unit that Windows cannot resolve. Older APIs often used this wording for drives and controller units, but modern software may still receive it from storage, removable-media, or compatibility layers.
What to check
- Confirm the drive letter, device path, and volume identifier are current.
- Enumerate devices again after hot-plug, resume, or media changes.
- Verify that a stale configuration did not retain a removed unit number.
- Inspect the lower-level driver status when the error comes from an IOCTL.
Recovery
Refresh device discovery and ask the user to select an available target. Repeating the same operation against a nonexistent unit is not useful. For services, avoid assuming that drive-letter assignments remain stable across sessions or machines.
References
Looking for a different code? Search another status or error code.