суббота, 3 ноября 2018 г.

Restoring windows 7 from system image

I was building a new PC and interestingly enough the night I created a Win installation usb drive using my old PC, the old PC died: next morning the boot disk (SSD Intel X-25M) was dead and unresponsive. Quick investigation with a Linux live CD (trying to repeat a success story from https://communities.intel.com/thread/26805 ) showed that it's not reporting to the kernel initialization commands (the whole "ata1: COMRESET failed (errno=-16)" thing), so I officially announced it dead and ordered a replacement. By that time the drive was 7 years old and go figure that it would die exactly on the day I'm ready to set up my new PC.

I was pretty confident that having a replacement SSD I can easily recover my system, because I had a full disk system image backup done with Windows 7 built in tools and stored on an external USB 3 Raid 1 device (Fantec MR-35DU).

This actually wasn't the case ...

Problem #1 was that I disposed of my DVD with recovery image written using Windows 7 backup tools, so I had to resort to an installation disk. I didn't have original CD/DVD, but had an image of it (among other images I have).

Now the problem is that bootable USB disk should have exactly the same Windows image as one that was used to create the backup. You have to match
* Language
* Boot mode of USB flash drive (UEFI / MBR)
* Installation disk for Win7 SP1 doesn't work for Win7 (no SP1) installation
otherwise you will get "This version of System Recovery Options is not compatible with the version of windows you are trying to repair. Try using a recovery disc that is compatible with this version of windows."

Given that I installed the system 7 years ago and a) didn't remember all the details; b) had more than 1 Win7 image; it took me a few trial and error steps to get to one that actually agrees to accept my backup.

Problem #2 was that at some point I lost my ability to boot into BIOS (ASUS Sabertooth P67) because it would no longer recognize my USB Logitech wireless KB/Mouse. I could swear it was working before, but no more. Some internet searching later I discovered that when the computer reaches a dead end after booting you can use "reset" button (lucky me - I had that button!) to reboot in a different mode that takes a bit more effort to recognize perepherial devices. Thanks to this Quora article about keyboard not working in BIOS!

Problem #3 the recovery tool from the windows 7 installation wouldn't recognize my external disk. This was relatively easy to solve when I realized that it was USB3 and I can plug USB3 into USB2 and it would work in compat mode. I guess my win7 image was predating USB3 and had no drivers for it. Of course it wasn't smart enough to tell me "I can't find you backup" instead it said "The system cannot find the file specified (0x80070002)". Switching to USB2 solved that.

Problem #4 was framkly quite upsetting. After the system found the backup, analyzed it, displayed the last date of the backup, asked which drives to format for recovering the backup, it failed once again with another cryptic message: "The system image restore failed. The parameter is incorrect. (0x80070057)". Luckily I was able to find this message that recommends to physically unplug the usb drive (with windows installation image) from the computer right before clicking the final "restore" button (keep in mind we are talking about the same disk that on the previous step I already marked with a checkbox "don't format"). With this (and after a while) I got my computer back!

Conclusion and lessons learned
Once again, it's not important to have a backup, it's important to be able to recover from it.
For my next windows installation I'll make sure to have the recovery disk created and regularly updated and at least aspire to try to recover the system from it once in a while.