Create an Image of Your Partition

Although the dd command is a great option for creating images of partitions, it creates a bit-by-bit copy so that it also copies empty space, making your partition large and slow to create. Partimage has the advantage of only copying your data to the image. This is good news in terms of time but also it reduces network resources if you transfer the image across the network to a network backup device. Partimage provides several options in terms of compression including gzip and bzip2 for best compression and restoration options. There are two components of Partimage, the client that can either create a backup image and store it locally or send the image across the network to a backup server.

Configure the Client

The first thing you will need to do is to install the partimage program on the local machine. If you have an Ubuntu machine the program is in the repository.

sudo apt-get install partimage

Once you have installed Partimage as root run the program as root.

sudo partimage

You will see that it must create the /dev/dm inode, click Yes to continue.

Now the opening screen will be available. One of the issues with simply doing the backup on one machine is that you cannot create the image on the same partition that you are running the program from. If you only have a swap partition, a /boot partition and a / partition you will not be able to create an image for /. Therefore you would need to use a network server connection. However, in this example, this is a good way to understand the program, you can see a USB drive is located at /dev/sdb1. This is used as an example so that you can become familiar with the program. Select the partition you want to use. All images are based on partitions, not folders. You must select the image name and location. In this example the image will be placed in the same directory as when you execute the command. If you wanted the image to be placed on a drive that was specifically created for backups and called /bk, you would change that line to read:

/bk/usb.img.gz

Be sure to select if you are saving or restoring an image or MBR. When this is set click F5.

The next window will allow you to choose the compression level. The three options are no compression, gzip or bzip2. The best compression occurs with bzip2 but you will have problems restoring a MBR with bzip2, so that must be a consideration. Other options include checking the partition before saving, entering a description of the backup and overwriting a previous backup automatically. You will also see split options for the images and options of what the machine should do after completion. The completion options are really related to if you are using a Live CD so you can complete the image and reboot the server.

Here is the bug report if you choose to use bzip2 for a Master Boot Image (MBR).

You will get a summary of the process about to be done.

When the process is complete you will get a verification.

Summary:
Partimage seems to be a stable program that does what it says and is easy to use, have you looked at other options out there? Be sure to test before you depend on any backup program.