m
 
(2 intermediate revisions by one user not shown)
Line 2: Line 2:
 
== Preamble ==
 
== Preamble ==
  
The imaging of Windows based computers can be performed with DISM (Deployment Image Servicing and Management) and a Windows PE Environment (Windows Pre-installation Environment). Both are available as part of the Windows Assessment and Deployment Kit (ADK) for Windows.
+
The imaging of Windows based computers can be performed with DISM (Deployment Image Servicing and Management) and a [http://technet.microsoft.com/en-us/library/hh825110.aspx Windows PE Environment] (Windows Pre-installation Environment). Both are available as part of the [http://technet.microsoft.com/en-us/library/hh824947.aspx Windows Assessment and Deployment Kit (ADK) for Windows].
  
 
DISM can work with two different image types. The Virtual Hard Disk (VHD) was designed for virtualisation and represents the physical disk. Windows Imaging Format (WIM) is a file-based disk image format developed to help deploy Vista and subsequent versions of Windows.
 
DISM can work with two different image types. The Virtual Hard Disk (VHD) was designed for virtualisation and represents the physical disk. Windows Imaging Format (WIM) is a file-based disk image format developed to help deploy Vista and subsequent versions of Windows.
Line 38: Line 38:
 
clean
 
clean
 
create partition primary size=100
 
create partition primary size=100
format quick fs=ntfs label="System"
+
format quick fs=fat32 label="System"
 
assign letter="S"
 
assign letter="S"
 
active
 
active
Line 58: Line 58:
  
 
<PRE>
 
<PRE>
bcdboot w:\Windows
+
bcdboot W:\Windows /s S:
 
</PRE>
 
</PRE>
  

Latest revision as of 11:01, 29 April 2014

Preamble

The imaging of Windows based computers can be performed with DISM (Deployment Image Servicing and Management) and a Windows PE Environment (Windows Pre-installation Environment). Both are available as part of the Windows Assessment and Deployment Kit (ADK) for Windows.

DISM can work with two different image types. The Virtual Hard Disk (VHD) was designed for virtualisation and represents the physical disk. Windows Imaging Format (WIM) is a file-based disk image format developed to help deploy Vista and subsequent versions of Windows.

WIMs are the preferred method of imaging. It supports compression, single instancing (only one copy of identical files are captured) and has better support for offline maintenance tasks.

The Windows PE Environment is a lightweight version of windows that can be loaded from removable media. It allows command line executables such as dism.exe to be executed on the host computer. Upon boot-up the C:\windows\system32\startnet.cmd file is executed and can be used to automate the deployment process.

Mapping Network Drives

WIM images can be stored on a NAS or network share for ease of backup and recovery. The net command can be used to map network shares within the Windows PE environment:

net use z: \\192.168.0.253\Images

Creating an Image

Creating a WIM image can be performed by booting into Windows PE and using the following command:

dism /Capture-Image /ImageFile:z:\Images\Saturn.wim /CaptureDir:H:\ /Name:"Clean Windows 8 install on Saturn"

Deploying an Image

A WIM image can be applied to the target machine by partitioning and formatting the hard disk drive, restoring (applying) the WIM to the windows partition and creating the boot configuration data (BCD).

Partitioning the hard disk

Create a system and windows partition by issuing diskpart.exe the following commands (These commands can be passed to diskpart.exe as a script)

Select disk 0
clean
create partition primary size=100
format quick fs=fat32 label="System"
assign letter="S"
active
create partition primary
format quick fs=ntfs label="Windows"
assign letter="W"
exit

Apply the image to the windows partition

dism /apply-image /imagefile:z:\Images\Saturn.wim /index:1 /ApplyDir:W:\

Create a basic system partition

Use BCDboot to create a basic system partition for booting. The BCDboot tool will copy a simple set of system files to a system partition. These files include boot configuration data (BCD) information that is used to start Windows.

bcdboot W:\Windows /s S:

Reboot

Reboot into your newly restored image.

Mounting an Image

WIMs can be mounted with read/write permissions for servicing. Create a mount point directory on your host. In this example, I use the D:\mount mount point

dism /Mount-Image /ImageFile:z:\images\saturn.wim /Index:1 /MountDir:D:\mount

The contents of the WIM should now be present in D:\mount\

Any changes can be committed using:

dism /Commit-Image /MountDir:D:\mount

Alternatively, any changes can be committed and the WIM unmounted using:

dism /Unmount-Image /MountDir:D:\mount /Commit

WIMs can be unmounted and any changes discarded using:

dism /Unmount-Image /MountDir:D:\mount /Discard