You have a computer that has a small volume created on a hard disk (100MB or less, for example).
The volume has less than 50% free space available.
The computer is booted using WinPE boot media created through the Windows OPK or Windows Automated Installation Kit (WAIK).
You use ImageX.exe to capture files and/or folders from the volume.
You later try to apply the WIM file that you created earlier using ImageX to the same volume.
In this scenario, you may receive an error message that there is not enough space on the target volume.
The native file system for Windows Vista and later operating systems is NTFS. NTFS uses compression on some files and directories to conserve space on the hard disk. However, when using ImageX to restore a WIM to the same volume it was captured from, files are restored in an uncompressed format. The file system will eventually recompress these files but it is independent of Imagex. Since ImageX is unable to force the file system to provide real-time compression as it deploys files back to the target volume, the total size of the uncompressed files may exceed the size of the volume. As a result, once all available space on the volume has been exhausted, you will receive an error message stating that there is not enough space.
Windows 7 and Windows Server 2008 R2 have the in-box command line utility DISM.exe which can be used to determine in advance if the target volume is smaller than the files contained in the WIM image. To check the uncompressed file size of the WIM, run the following DISM command at an elevated command prompt (replacing <pathto> with the path to the WIM file you created and filename.wim with the name of your WIM file):
If the target volume is smaller than the total size of the files contained in the WIM image, you can try one of the following methods to work around this:
Use ImageX with the /split parameter to split the WIM into multiple sections. Applying the WIM in multiple sections may force disk compression to occur in between appliction of the sections instead of via a lazy write or reboot. To split the WIM into multiple sections, use the following steps:
Install the Windows OPK or Automated Install Kit tools. Links can be found at the end of this article.
Open an Administrative command prompt.
Run the following ImageX command on your WIM image that you've created to split the WIM file into multiple read-only WIM files, which will have an .SWM extension once split:
Imagex.exe [FLAGS] /SPLIT image_filedest_filesize
image_file - The path and file name of the WIM file that you want to split. dest_file - The destination path and file name of the split files. size - The maximum size in megabytes for each created file.
NOTE: When you are ready to restore the split *.SWM files, be sure that all SWM files are in the same root or folder location prior to running ImageX.
Manually apply the WIM to a folder on a different computer, extract some files and/or folders to reduce the size of the WIM and then capture the WIM again, which should now be reduced in size. You can then create a second WIM that contains the extracted files and/or folders, as long as it does not contain any of the same files and/or folders that the first WIM contains. The following steps can be used to complete this process:
Copy your WIM file to writable media other than the target volume that you want to restore to.
Create a folder on the writable media (ex. MOUNT).
If the WIM information is not known, retrieve it using the following DISM command at an elevated command prompt: Dism /get-wiminfo /wimfile:<pathto>filename.WIM
Apply the WIM file to the MOUNT folder that you created off of the root of the writable media: Imagex.exe /apply filename.wim 1 <driveletter>:\MOUNT
Create a second folder (ex. MOUNT2).
Move some of the files from the \MOUNT folder to the MOUNT2 folder. Make sure that you use the MOVE command as opposed to the COPY command to ensure that there are not redundant files.
Capture the contents of the MOUNT folder into your first WIM using the following command: Imagex /capture \mount c:\Image1.WIM "Image part 1"
Capture the contents of the MOUNT2 folder into your second WIM file: Imagex /capture \mount2 c:\Image2.WIM "Image part 2"
Once you have captured both WIMs, be sure to test to ensure that each WIM file deploys successfully. A reboot should not be required between deployment of each WIM file.
Alternatively, a 3rd-party sector-based imaging solution can be used.
For more information on the Windows Automated Installation Kit and ImageX command-line options, click on one of the following links: