A WIM file is saved in a file-based imaging format and this was first introduced in Windows Vista. A WIM file enables you to deploy a single disk image to numerous devices. WIM files are used to manage files such as drivers, updates, Language Packs (LPs), Local Experience packs (LXPs) and other components without booting the operating system image.
This error is as a result of corruption of the *wim file in my case. In this guide, we will look at how do you un-mount and cleaanup a Wim Image file using the DISM tool.
I found out in my case, remounting did not help in resolving my issue. You could try this and if this does not work for you, simply move to the steps discussed below. This command simply help recover an orphaned image mount directory.
dism /remount-wim /MountDir:<mountDir>
On the already mounted Wim image, it makes sense to see if the image is correctly mounted. To do this, run the following command (this command can be modified to support your file structure/path). Run the command below to get the mounted WIM information.
Therefore, to resolve this issue, the steps below helped me. First, we will have to unmount using one of the commands below that suits your environment.
1: Force umount by discarding the wim file
- dism /unmount-Wim /MountDir: /Discard
- dism /Unmount-Wim /MountDir:C:\path-to-the-mount\Mount-A /discard
When this step is complete, the next thing to do is to clean the WIM file
– This is only needed when you intend to use the same wim file to ensure all errors are cleared.
– If there are changes in the WIM file, please delete it and copy it again from the source.
Now the WIM file size has not changed, there is no need to get (extract) a new wim file from the source (ISO, and DVD). Just proceed with the steps below to clean the wim file.
C:\windows\system32>dism /Cleanup-Wim ------------------------------------- Deployment Image Servicing and Management tool Version: Scanning drive C for stale files Scanning drive G for stale files The operation completed successfully.
Now you can proceed to mount the WIM file again as there are no errors reported and the file size remains unchanged. To do this, use the command below.
dism /Mount-Wim /WimFile:<Path>image.wim /Index:<indexnumber> /MountDir:<mountDir>
Now, you can proceed to add or remove packages packages without any error.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.