I guess most of you share my same problem: friends are continuously asking for help installing their PCs, and most of the time is Windows. That would not be a problem if it was any sort of Linux distribution, re-installing using a pre-seed (Debian/Ubuntu) or Kickstart (CentOS/Fedora/RedHat) is pretty straightforward. Windows is pretty a beast and has to be prepared for each PC: drivers, applications, …. unless you’re a super-duper Windows ninja and you have your own sysprep, is unlikely you will have the full ready-to-go environment.

How many times your friends come back, after you installed the PC once ago, and asked for re-installation again? It happens a lot of times, at least for myself. The idea was then to create an OEM-like recovery partition, i.e. a partition that holds the Windows image and the program that is able to recover it. The idea was quite simple: using Clonezilla to accomplish the task. But how to automate the recovery partition was another story. Here’s the receipt:

  1. Before installing Windows, make sure you create a small extra partition, let’s say 10GB to be safe
  2. Install your Windows (XP/Vista/seven/…), drivers, windows patches, applications and whatever is needed for your friend(s)
  3. Format the second partition as FAT32 (VFAT) and label it, say for example RECOVERY
  4. Make sure the installation is clean, the drive is defragmented and … empty the Trash! 🙂
  5. Download grub4dos and place it in a convenient directory, say C:GRUB4DOS
  6. Copy file grldr into the root of the boot disk, es: C:grldr
  7. Unhide the C:boot.ini and modify it by adding a line such as: C:grldr=”Recovery procedure”
  8. Download Clonezilla Live for hard disk: basically it’s a zip file that has to be uncompressed into the root of the recovery partition as is
  9. Create a “menu.lst” file in the C: partition and populate as suggested at point five of the clonezilla how-to. Be aware of that configuration is buggy and rename vmlinuz1 and initrd1.img with vmlinuz and initrd.img that are held in the /live directory of the recovery partition.

Once you select the “recovery procedure” menu at boot time, the Windows bootloader will chainload grub4dos that will load the kernel and the initrd of Clonezilla. As such, you will have a full functional Clonezilla Live from the recovery partition. At this stage, through the Clonezilla menu, you will be able to dump and recover the partition. Use the local_dev and mount the recovery partition to hold the actual image.
Enjoy

2011-04-27