| Previous | Next |
| ERROR_DEVICE_NOT_PARTITIONED | ERROR_UNABLE_TO_UNLOAD_MEDIA |
ERROR_UNABLE_TO_LOCK_MEDIA
unable to lock the media eject mechanism.
ERROR_UNABLE_TO_LOCK_MEDIA means that windows or the device could not prevent removal of the currently loaded removable medium.
Where the result appears
- backup software preparing a tape job.
- optical, removable, or sequential devices with software-controlled eject locks.
- library robotics coordinating drive ownership.
- maintenance tools that require stable media during a long operation.
Typical causes
- the device does not support locking or is in a state that rejects it.
- another process, service, or library manager owns the device.
- media is being ejected, unloaded, or changed.
- driver, firmware, reservation, or hardware problems prevented the command.
What to collect
- device path, media type, owner process/service, and reservation state.
- the exact lock command, returned device status, and sense data.
- library and removable-storage service events.
- whether a physical operator or automation system initiated unload.
Handling and recovery
Do not start a destructive or long-running operation that assumes stable media when the lock failed. Resolve ownership and device state, then retry once the condition changes. On hardware without locking support, require an operational safeguard instead of pretending the media is secured.
Common misinterpretation
The code does not necessarily mean the media itself is write-locked. It concerns the eject/removal mechanism.
References
Looking for a different code? Search another status or error code.
