7

I use DISM to customize and update images that I deploy to our computers. I do this on an external drive because its really heavy on I/O. A while ago I appear to have left the image mounted in my F drive as F:\WIN81MOUNT. The files are there. Running dism /get-mountedwiminfo however shows that there are no mounted WIMs. As such, I have no idea how to delete WIN81MOUNT as I cannot remount, unmount, or just delete the folder (files have permissions of things like SYSTEM, as they are in the windows image).

How can I force this WIM to unmount, or remount? I have tried all the standard options such as unmount-wim, cleanup-image, remount-wim... none of them work, saying the request is not supported. The log indicates "This is not a WIM mount point.".

Mgamerz
  • 171

5 Answers5

3

None of the above worked for me as it appeared there was nothing to clean on the dism part, juste the permissions on the folder.

I finally found something working (if the registry and dism solutions listed above don't work) :

First you must change the owner permissionf of "damaged" mount folder:

Right-Click the folder -> Properties -> Security tab -> Advanced button -> Owner tab -> Edit button -> Select your user account -> Activate Replace owner on subcontainers and objects.

When done, close all properties windows and open Properties again -> Security tab -> Advanced button -> Permissons tab -> Change Permissons button -> Add your user account and select Replace all child object...

Then open command promt with administrator priviledges ( https://technet.microsoft.com/fi-fi/library/cc947813%28v=ws.10%29.aspx )

Type the following and press enter:

DISM /Cleanup-Wim Now you should be able to able to delete all leftover files/folders.

Source : https://www.wincert.net/forum/topic/12680-cant-delete-wintoolkit_mount-folder/?do=findComment&comment=116249

2

Following info is from "http://trueliarx.blogspot.co.uk/2014/07/force-unmount-and-clean-up-of-wim-image.html"

Force Unmount and Clean up of a Wim Image using DISM

When you use RT7 (+ AIK) sometimes an error occurs stating that there's a mounted wim (ex. boot.wim).

To solve the problem you should run, as administrator, the command:

dism /cleanup-wim

If it doesn't work I've found another solution by editing the registry and deleting all the (necessary) entries within:

HKLM\SOFTWARE\Microsoft\WIMMount\mounted images\

It should work as long as you are an administrator.

The regular procedure, which you've already used (?) is shown below:

  1. Information can be found in the log file can be found at: C:\Windows\Logs\DISM\dism.log

  2. In the case of 64bit servicing tools previously run on 64bit Windows;

    1. In an elevated command prompt issue;

      cd C:\Program Files\Windows AIK\Tools\amd64\Servicing
      
    2. In the same elevated command prompt issue;

      dism /?
      

      Some helpful information may be displayed.

    3. In the same elevated command prompt issue;

      dism /Get-MountedWimInfo
      

      Information about mounted images may be displayed.

    4. If there are any Dirs found to be mounted, which need to be un-mounted, for each Dir issue;

      dism /Unmount-Wim /Mountdir:C:\examplepath /commit
      

After this is complete the related wim files, found with Get-MountedWimInfo, can be deleted using Windows Explorer.

G304G4
  • 21
0

As a last resort:

  1. Open the registry and go at key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\Mounted Images.
  2. There, you should find one or more subkeys with strange names such as [e86b54b7-dc5f-4c15-8eb5-9b615bc3b154]
  3. Open the first of these folders and find out if it corresponds to the mounted image that looks corrupted; use the values [Mount Path], [WIM Path] and [Image Index] to find out.Once you have found the correct subkey mentionned in point 2 above, delete it.
  4. Delete and recreate the Mount folder..
0

Loop through and unmount any left over Wim with PowerShell.

$subKeyMatch = "Mount Path"
$orphMountedWims = @()
$regMounted = "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\mounted images"
$mountedKey = [array](Get-ChildItem "$($regMounted)\" -Recurse -Depth 0)
foreach ($key in $mountedKey) {
    $keyProps = ((Get-Item -path "REGISTRY::$key").property)
    foreach ($subKey in $keyProps) {
        if ($subKey -like "$($subKeyMatch)") {
            $regSubPropValue = Get-ItemProperty -path "REGISTRY::$Key" | Select-Object -ExpandProperty $subKey 
            $orphMountedWims += $regSubPropValue
        }
    }
}

if (($orphMountedWims | Measure-Object).Count -ge 1) { Write-Warning "Orphaned WIM(s) have been found." foreach ($oMWim in $orphMountedWims) { try { Write-Output "Attempting to dismount and discard changes for Orphaned [Path: $($oMWim)]" Dismount-WindowsImage -Path "$($oMWim)"-Discard Write-Output "Success discarding changes." } catch [System.exception] {
Write-Error "Error - Failed to dismount and dicard changed from Orphaned wim [Mount Path: $($oMWim)]. Error: $($_.exception.message)" continue } } } else { Write-output "No Orphaned WIM files found, module clear to run." }

SCCMOG
  • 1
  • 1
0

Do this (replace c:\winmount with your mount point):

dism /Unmount-Wim /Mountdir:C:\winmount /discard

If you try /commit instead of /discard, often this will fail.

This works even if dism /Get-MountedWimInfo shows no mounted images.