Active Directory/Documentation/WDS/Management/Images/Mounting WIMs with DISM

From WolfTech
Jump to navigation Jump to search

Mounting

To mount a WIM file using the DISM tool, follow this procedure:

  1. Open a Deployment Tools Command Prompt (using elevated/Administrator privileges)
  2. Navigate to the location of the WIM file (e.g., "cd \storage\Images\Boot")
  3. Create, if needed, a directory to mount the WIM file (e.g., "mkdir \storage\Images\mounted")
  4. Determine which WIM index to mount:
    1. Execute "dism /get-wiminfo /wimfile:<wimImageFile>"
    2. Examine the output to find the index number corresponding to the image you want updated:
      • Most custom WIMs will only contain one image, with an index of 1
      • Existing WIMs from Microsoft media will generally contain 2 images, one usually being the Windows PE environment, and two being the WDS boot client
      • If you are adding network (or other) drivers to the WDS boot images, you almost always want to use the WDS boot client image.
    3. Note the index number belonging to the image within the WIM that you want to mount
  5. Execute the following: "dism /mount-wim /wimfile:<wimImageFile> /index:<index#> /mountdir:<mountDirectory>"

A production example is: 'dism /mount-wim /wimfile:"Windows 7 - Stock.wim" /index:2 /mountdir:..\..\wimMount' - note the use of quotation marks around the filename of a WIM file that has spaces in the name.

Unmounting

To unmount a WIM file using the DISM tool, follow this procedure:

  1. If one is not already open, open a Deployment Tools Command Prompt (using elevated/Administrator privileges)
  2. Navigate to the location of the WIM file (e.g., "cd \storage\Images\Boot")
  3. Execute "dism /unmount-wim /mountdir:<mountDirectory> {/commit|/discard}"
    • If you want to save the changes you made to the WIM, use the /commit option.
    • If you do not want to save the changes you made to the WIM, use the /discard option.

A production example from the same session as the previous example is: "dism /unmount-wim /mountdir:..\..\wimMount /commit"