This post follows the previous post in were I explained how I bought a new ASUS laptop with preinstalled Windows 7 PRO x64 OEM and they didn’t give me the restore DVDs. Instead they had a retarded restoring system that relied on a 20GB partition in the HD that got useless when I changed my Partitions to use the Striped and Mirror features that come with the OS.
In this post I’ll explain how to manually create a set of DVDs from the original ASUS system image files named asus.swm, asus2.swm and asus3.swm. This method can be used for other brands that have the same type of lame restoring system or if you want to split an image bigger than the size of a DVD (usually the split is named install.swm install2.swm install3.swm).
After you finish reading your post you’ll be able to create a set of DVDs/CDs of the size you want and have a bootable DVD/CD that will automate the restoring and prompting to introduce the next disk. I’m going to add as many details and explanations as I can to allow non developers to be able to understand the process and create their set of DVDs. So if you find it too easy, skim through. If you find it still complicated, add a comment and I’ll try to give more samples (you can read the MS documentation as well).
To create the recovery DVDs we are going to need “Windows Automated Installation Kit for Windows 7” (Windows 7 AIK) installed (you can download it and install it for free). This is the set of tools that the laptop manufacturers use create the images that are installed in your system. This post can also be used as a tutorial to understand the process of deployment using Windows 7 AIK (the steps used here are taken out from Microsoft documentation and they are using the tools that MS has made freely available to users to deploy Windows in an alternative way to standard setup). I take no responsibility of any errors in the scripts that I’ll be providing in the next post and I take no responsibility of the information that could be lost by using these steps. Please take your time to read the official Microsoft documentation about the tools and the risks of using them (http://technet.microsoft.com/en-us/library/dd744356%28WS.10%29.aspx) and remember that restoring the image will wipe out all the data in your HD so you need to run a backup of your data before you restore your system. And remember that these instructions should never be used to install Windows in a computer other to the one that you have paid the license for (no license no install). Please read read your Windows license agreement before following the steps to install your Windows image.
Lets get started!
Before we start with the process ne need to have the full image file (install.wim or asus.wim or image.wim) or the image already split in parts (asus.swm, asus2.swm and asus3.swm or install.swm install2.swm install3.swm). If you want to change the size to use double layer DVDs or CDs or a Blu-Ray or any other thing, you can join your image and then split it back in the size that you want. To do that you can use imagex command to:
- imagex /split C:\imaging\asus.wim D:\imaging\asus.swm 4000
- imagex /split C:\imaging\install.wim D:\imaging\install.swm 4000
- imagex /ref asus*.swm /check /export asus.swm 1 asus.wim
- imagex /ref install*.swm /check /export install.swm 1 install.wim
Now that we have our images with the size that we want, we are going to start.
Create a bootable DVD to start the process
To restore the system we need to create a bootable DVD with all the tools required to boot, configuration files to create partitions and scripts to restore the image.
In this process I will assume that we have installed Win AIK in the standard path (c:) and that we want to do the work in the d: drive.
- Start Windows AIK command line as an administrator
- Get the required files for the boot DVD (boot image with standard MS tools)
- copype.cmd x86 d:\winpe_x86
- Mount the image to add custom restore scripts (this is similar to mounting an ISO but here we use a folder for you to modify the files)
- imagex.exe /mountrw d:\winpe_x86\winpe.wim 1 d:\winpe_x86\mount
- mount winpe.wim (MS boot image) in the folder that we specify)
- In this step we will copy the restore script and the commands to re create the disk partitions (I’ll explain this later in the next post). However, with the DVDs you can already manually restore your system once you boot with the first restoring disk (the process requires to create 2 partitions, 1 for Windows and 1 to copy the *swm files)
- restore.cmd: script to restore the system automatically
- clear_partitions.txt: Cleans the Hard drive
- create_partitions.txt: Creates the partitions before restoring the image
copy restore.cmd d:\winpe_x86\mount\Windows\System32\
copy clear_partitions.txt d:\winpe_x86\mount\Windows\System32\
copy create_partitions.txt d:\winpe_x86\mount\Windows\System32\
- Modify startup to call our restore script (This step required opening notepad as administrator. You can launch it from an Administrator command line)
- notepad.exe d:\winpe_x86\mount\Windows\System32\System32\startnet.cmd
- startnet.cmd is the script the is executed when booting the DVD. We need to add an extra line at the end of the file to call our restore.cmd script
- What we have done here is to call our script to start the restoring process. This allows us to create an automated restoring process for simplicity.
- Save the changes in the customized image (commit the changes to the mounted boot image)
imagex.exe /unmount /commit d:\winpe_x86\mount
imagex.exe /unmount d:\winpe_x86\mount
imagex.exe /unmount /cleanup
Note: For some reason, sometimes the first command sometimes doesn’t do all the work and there are files still hanging around. Most likely the command has successfully updated the image but it can’t unmount and release the files. If this happens, you need to close all the Windows Explorer windows and run the second and third commands (some times even several times) until “imagex.exe /unmount /cleanup” tells you that nothing is mounted.
- Create the DVD folders (each folder will be one DVD)Create folders:
d:\ASUS\DVD1\sources (this will be the bootable DVD)
d:\ASUS\DVD3\sourcescopy asus.swm d:\ASUS\DVD1\sources
copy asus2.swm d:\ASUS\DVD2\sources
copy asus3.swm d:\ASUS\DVD3\sources
- Add extra required tools to DVD1 to make the DVD bootable and copy the program used to restore the system
xcopy /y /e d:\winpe_x86\ISO\*.* e:\ASUS\DVD1\
copy “C:\Program Files\Windows AIK\Tools\x86\imagex.exe” d:\ASUS\DVD1\
- Copy customized boot to DVD1 (created in step 6)
- copy d:\winpe_x86\winpe.wim d:\ASUS\DVD1\sources\boot.wim
- Notice the change of name. The destination name must be boot.wim
- Create the disk images (notice that the first one is bootable)
oscdimg -m -n -b”d:\winpe_x86\etfsboot.com” D:\ASUS\DVD1 D:\ASUS\DVD1.iso
oscdimg -m -n D:\ASUS\DVD2 D:\ASUS\DVD2.iso
oscdimg -m -n D:\ASUS\DVD3 D:\ASUS\DVD3.iso
- Burn images to DVDs (with Windows 7 right click on the ISO and choose burn)
- Congratulations! You have created your set of restoring DVDs.
In the next post I’ll explain how to fully automate the process creating the scripts from the step 4.
Update: I have added a new post in where I explain how to fully customise the WIM image, update it with service packs and updates and remove bundled crap to create an updated and clean image that can be safely used to bring your computer to a clean state without the pain of running all the Windows updates again. Please check my post.