Tuesday, August 25, 2009

Backing up and Restoring Windows Installation using Open-source/free tools

The other day, I was hit with some virus that took over my Primary Machine (DELL XPS M1330) with Windows XP SP3 on it.

Tried restoring the Machine using a Full Windows Backup that I took just the previous day, without any success. Tried all kinds of tools to remove the virus, but, the damn thing will just not go away.

Tried Malwarebytes' Anti-Malware, Avira AntiVir Rescue System and several others, needless to say nothing worked.

Finally, I ended up re-intalling the OS, applied all the windows updates, Hardware Drivers and all, took me hours to get my machine working again.

There is an "Advanced Mode" in Windows Accessories->System Tools->Backup which will help you choose what files you want to restore from your backup set. Using that, I was fortunate enough to recover all my data.



Anyway, this whole fiasco prompted me to seriously start looking at the "Ghosting" solutions that will minimize the effort to restore the whole system without much pain.

This is what I ended up doing, I was able to Restore the whole OS (with all the programs and settings) to a new hard disk also, so it worked.

1. Download and Install DriveImage XML free edition.

2. Create a BKUP_DRIVE_C.BAT command file in notepad with the following tex in it.

del E:\Images\DriveC.dat
del E:\Images\DriveC.xml
"C:\Program Files\Runtime Software\DriveImage XML\dixml.exe" /bc /tE:\Images\DriveC /r- /s- /c /v

where E: is a USB drive with large enough free space to store all data on your C: drive.

3. Run the command file (should run for 20-30 minutes depending on the size of your data on C:). Took 19 minutes for me to backup 35GB

4. Download and Install Ultimate Boot CD for Windows, you will need your Windows XP installation CD to create a Bootable disk with Ultimate Boot CD.

Needless to say, you should do steps 1-4 before your OS/Disk gets screwed:D

5. When ready to recover your OS (or trying to create a clone of the existing good OS installation, or replace a bad hard drive), just pop in your bootable UBCD4WIN that you created in step 4 and run DriveImage XML once your machine boots into Windows. Use the "RESTORE" option. You should be able to restore the whole system in 40-50 minutes.

Few things to keep in mind:
i. DriveImage XML free edition will not restore to a Hard Disk with smaller overall size than the original one,e.g., if your Backup was created with on a 250GB Disk, you will not be able to RESTORE that to a 120GB Disk, even if you actual data size (to restore) is only 30GB.
ii. After you are done running the restore, don't forget to mark you disk "Active" using "Windows Disk Management" tool that is included in DriveImage.
iii. If you get the following error trying to boot with the restored disk:

"Windows could not start because of disk hardware configuration problem. Could not read the selected boot disk. Check the boot path and disk hardware."

Do the following:
1.Boot you computer with Windows XP CD
2.When given the option to Install OS, press "R" to enter Windows Recovery Console
3.Select the windows installation and enter the Admin password when prompted
4.Once logged in, type bootcfg /rebuild at C:\WINDOWS prompt.
5. Follow the direction on the following Microsoft KB article


You OS should boot without any problem now, mine did!