Backing up images for install testing

Testing certain upgrade and install scenarios such as Wubi and Migration Assistant require a configuration of existing partitions of Linux and/or Windows installs. Some of this can be done in a virtual environment but it is sometimes desirable to perform this testing on real hardware.

This guide describes how to back up existing partitions to another partition or to external storage so that the setup used for testing can be preserved and tests can be repeated efficiently.

Creating a backup image

This guide assumes that you are backing up your partitions to an external USB drive. A local partition or a network resource can also be used.

Step 1: Download and burn an Ubuntu Live CD.

Step 2: When you boot the Live CD your external USB drive should be mounted automatically, most likely under /media/disk. If not, mount it manually with:

sudo mkdir /mnt/sda5  
sudo mount -t ext3 /dev/sda5 /mnt/sda5

where sda5 is the USB HD device name. If you are unsure of the device name then type "dmesg | tail" and that should notify of the last event that happened, adding the USB HD. You should see a line like [32857.174839] sdb: sdb1 (this means that the device name is sdb1)

Step 3: Install the partimage program

universe.png

sudo apt-get install partimage

Alternative: If you install the Live system on USB pen drive in persistent mode you can install partimage once and use repeatedly. An alternative is System Rescue CD, a Live CD with partimage already installed.

Step 4: Run partimage

sudo partimage

You will see the following text-based GUI:

partimage-2.png

Navigate using TAB, SHIFT-TAB and arrow keys, then activate items with SPACE.

The image created will end in ".000" this is in case it needs to continue the image over multiple files.

Alternative: Local partition or network drive. Use qtparted ot gparted to create a spare partition on your drive for backing up to.

Restoring from the backup

Step 1: Boot from your Live CD and install partimage as above.

Step 1: Mount the USB drive as above.

Step 3: Run partimage.

That should then start the restore process. Wait for it to finish. Your now good to go.

Step 4: Fixing MBR.

partimage restmbr /mnt/sda5/my_main_pc.000

Testing/Backing_Up (last edited 2008-08-06 16:59:50 by localhost)