Capture Images of Hard Disk Partitions by Using ImageX
Applies To: Windows 7, Windows Server 2008 R2
Note
This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.
You can use the ImageX tool to capture Windows® Image (.wim) files for deployment.
Prerequisites
Create a Windows PE disk with the ImageX tool added. See Walkthrough: Create a Bootable Windows PE RAM Disk on CD-ROM for instructions on creating a Bootable Windows PE RAM disk, including the optional steps for adding ImageX.
Create an ImageX configuration file. For more information, see Create an ImageX Configuration File.
Create a reference computer by deploying Windows, and then removing the computer-specific information from the system. For more information, see Prepare to Capture an Image for Deployment (Generalize).
Determining which partitions to capture
This table shows the types of partitions that you must capture and those that are managed automatically.
Partition type | Should you capture this partition? |
---|---|
System partition (BIOS system partition or EFI System Partition) |
Optional. If only a simple set of partition files is required, you do not need to capture this partition. |
Microsoft Reserved partition (MSR) |
No. |
Primary partitions (Windows partitions, utility partitions) |
Yes. |
Extended partition |
No. |
Logical partitions (Windows partitions, utility partitions) |
Yes. |
Capturing an image
Start your reference computer by using Windows PE. For more information, see Booting Windows PE.
If any of the partitions you want to capture do not already have a drive letter assigned, assign a letter using the DiskPart command.
At the Windows PE command prompt, type
diskpart
to open the DiskPart tool.X:> diskpart DISKPART>
Select the hard disk with the
select disk
command. For example,DISKPART> select disk 0
View the partitions with the
list partition
command. For example,DISKPART> list partition DISKPART> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 Primary 300 MB 1024 KB Partition 2 Primary 200 GB 301 MB
Select the partition with the
select partition
command. For example,DISKPART> select partition=1
Assign a letter to the partition with the
assign letter
command. For example,DISKPART> assign letter=S
Type
exit
to return to the Windows PE command prompt.DISKPART> exit X:\>
For more information, see the DiskPart Help from the command line, or Diskpart Command line syntax.
At the Windows PE command prompt, open the directory that contains the ImageX tool. For example,
cd C:\Windows\System32
Capture images for each customized partition.
To capture the images, use the ImageX command with the /capture option. For example,
imagex /capture c:\ c:\my-windows-partition.wim "My Windows partition" imagex /capture s:\ c:\my-system-partition.wim "My system partition"
Optionally, you can set the following additional options to the imagex /capture command: /boot, /check, /compress, /config, and /scroll, and /verify. For more information about these flags, see ImageX Command-Line Options.
Connect to your distribution share by using the net use command. For example,
net use n: \\Server\Share
If prompted, provide your network credentials.
Copy the partitions to your network share. For example,
md N:\Images\ copy C:\my-windows-partition.wim N:\Images\ copy c:\my-system-partition.wim N:\Images\
Next Steps
After the image is captured and stored, you can:
Mount it to your reference computer for modification. For more information, see Mount and Modify an Image.
Split the file into smaller files. For more information, see Split an Image.
Apply the images to a destination computer. For more information, see Apply Images by Using ImageX.
Set up network-based installation of Windows. For more information, see Deploy Windows Using Windows Deployment Services.
Set up Windows on a Virtual Hard Disk. For more information, see Deploy Windows on a Virtual Hard Disk with Native Boot.
Set up Windows using other deployment options. For information, see Other Deployment Options.
Service the image. For more information, see Service an Offline Image.