Error: “An error occurred while unmounting the image file” in Media Wizard

Symptoms

When creating media in Media Wizard, you may receive the following error message:
"An error occurred while unmounting the image file."

Cause

This error is commonly caused by a compatibility issue between the SmartDeploy Media Wizard and the installed version of the Windows Assessment and Deployment Kit (ADK). This is especially prevalent when working with Windows 11 24H2 or Windows Server 2025 devices, where older or mismatched ADK versions may not function as expected.

Note that this error can occur regardless of the storage device size or type you're using (including various USB flash drives or external hard drives).

Note: While ADK compatibility is the most common cause, other issues may result in this error.
If you've confirmed that you're using the correct version of the ADK for your operating system, please submit a support ticket and include the following log file:
C:\SmartDeploy\Logs\MediaWizard.log
(If you installed SmartDeploy to a different location, such as D:\ or E:\, check that path instead.)

Resolution

To resolve this issue:

  1. Install the latest Windows ADK and Windows PE add-on
  2. Delete the contents of the SmartDeploy scratch folder
    • Navigate to C:\SmartDeploy\Scratch 
      • Note C:\SmartDeploy is the default, you might be using a different drive
    • Delete all contents in this folder, do not delete the scratch folder itself.
  3. Recreate your media
    • Open the SmartDeploy Console
    • Launch Media Wizard and try creating the media again

Additional Troubleshooting

If the steps above don't resolve the issue, try these additional troubleshooting methods:

  1. Prepare your USB drive using diskpart
    • Open an elevated Command Prompt 
    • Type diskpart and press Enter
    • Type list disk to identify your USB drive
    • Type select disk X (replace X with your USB drive number)
    • Type clean
    • Type create partition primary active
    • Type format quick fs=ntfs
    • Try creating the media again
  2. Check for security software interference
    • Temporarily disable antivirus or security software that might be blocking access
  3. Restart your computer
    • A simple restart can sometimes resolve mounting/unmounting issues
Was this article helpful?
Still have a question or want to share what you have learned? Visit our Community Discord to get help and collaborate with others.