Posted by: mattmole | July 1, 2010

Creating a recovery partition using open source tools

I decided to do the research for this post for a number of reasons.

Firstly at work I look after a huge number of laptops. We recently decided to buy are bones laptops and install the operating system etc manually. This has result in a huge cost saving, but of course it does mean that it takes more time to setup initially. There is an obvious PXE booting and imaging point to be made here, and that will be addressed in another post. The reason I want this set up is so that at anytime when Windows system files are corrupted I can boot into a “recovery” mode and recreate the laptop from the original image.

Secondly I have used this sort of system before both at work and on various personal computers that I have rebuilt for people. I have often wondered how this sort of system worked and decided that as I knew the sort of things to use I should put them all together and get something to work.

While I have stated that Windows can be imaged, that is true, but it is not the only sort of operating system that can be cloned. The tool used (clonezilla) supports a large number of filesystems, including NTFS, FAT??, EXT3, EXT4, HFS+, reiserfs, etc.

I will try to make it clear the steps that can be ignored if you want to boot clonezilla from a linux machine running grub rather than a windows machine using the ntloader.

Recipe

Ingredients:

Clonezilla

Grub4dos

Method

  • We will need a separate partition to store any images. I have also chosen to store the recovery software (clonezilla) on this partition. Windows 7 creates a small (100Mb) partition for boot purposes. The scheme I used for Windows 7 was to use all primary partition, 100Mb NTFS for Boot, 280Gb NTFS for Windows 7 and 30GB NTFS for the clonezilla recovery information and clonezilla itself. For this I used the partition editor built into Win 7 but of course gparted, partedmagic would do the job easily as well.
  • The second step is to add the grub4dos bootloader to the Windows HDD and to call that from the Windows bootloader. There are two separate sets of instructions for this
  1. Windows 7 / Vista – These OSs seem to have some sort of registry (what the hell is wrong with text config. files) for storing the boot loader options. Instructions are available here. These instructions require a number of commands to be called. Also this section of the webpage talks about the files to copy for Windows 7 to use. NB: The files needed are slightly different to that when booting from the XP bootloader.
  2. Windows XP – This OS uses a text file. Instructions can be found here

The following instructions apply when booting from GRUB. Grub4dos uses the same configuration scheme as GRUB1, so if you use GRUB2 these instructions are not quite correct!

  • The menu.lst file copied from the grub4dos archive needs to be edited with the following:

================================================
title Clonezilla live on harddrive
root (hd0,3)
kernel /live-hd/vmlinuz boot=live union=aufs vga=788 ip=frommedia live-media-path=/live-hd bootfrom=/dev/hda4 toram=filesystem.squashfs
initrd /live-hd/initrd.img
boot

================================================

The Kernel line should be edited to point to where the vmlinuz file is. The hda4 reference should be changed depending on which partition the clonezilla files are stored on.

Also the initrd line needs to be edited accordingly.

The root line should also be changed. Currently this says boot from the first harddisk (disk 0) and the fourth partition (counting from zero remember). This needs to relate to the HDD the clonezilla files are stored on.


Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.