Linux Geek‎ > ‎

"Ghost" Image backup

posted Apr 5, 2009 6:48 AM by Bruno Braga   [ updated Nov 9, 2009 6:52 PM ]

After struggling a little bit on ways to guarantee a faster system restore after messing up with my computer (that's the downside of the open source world, as you can do anything you want, it is rather easier to irreversibly crash your system), I finally came up with a solution that is serving good to me.

Coming from the Windows environment, the idea of Ghost Image is still the best, and safest way to backup the system. Looking into some similar solutions for Linux, I found the partimage application, that is provided in many rescue cds on the net. My choice was: SystemRescueCD.

A catch


Imagining a simpler system like my own (a laptop booting on a single EXT3 partition, plus Swap and that's it), the backup can only be done from an external hard-drive. I did it using a USB external storage.

A bug


The partimage, although very good application, still does not work for the smallest compression option (Bzip2). The Gzip is good enough (around 20% of the original system size).

My steps

1) Mount the external storage

This thing you need to do manually, but it is no trouble at all, if you know what you need to do... since I was in this group, it took me a while, hehe...

In my case I am mounting a NTFS drive, so that I can transport files to multiple OS without problems (and over 4GB). Just Mac has issues with NTFS, as the drives are read-only.

# Create mounting directory
mkdir /mnt/{your drive name}

# Mount the storage
mount.ntfs-3g /dev/{device code} /mnt/{your drive name}

* If you do not know your device code, you may get it by running the partimage once, the first screen will display the available hard drive devices.

Your screen would be something like this:



2) Run the partimage application


Once you already know here to place the image file, let's go to the partimage.

Just type partimage (see image above), and the following screen will show up to you:


My settings here are simple:
  • Select the drive to create the image (in my case, a single EXT3 extension contains my complete Ubuntu 8.10 OS)
  • Select the output file (here you have to remember the complete address to wherever you want to put it - my suggestion: leave things simple here, and put the file in your root directory, later you can move it anyway)
  • Select that you want to create an image file
Then, click F5 to go to the next step:


My settings here are:
  • compression Gzip (medium), do not use the Bzip2, because it is bugged.
  • unmark the "check partition" option, unless you want this extra job to be performed when you create the image
  • define a reasonable file split size, in case your backup will result in a large file (let's say, 10GB).  I would suggest leaving the default of 2GB per file.
Then, click F5 to go to the next step:


As the setting in the previous screen, leave a comment that may help you remember about what is in this image. Then just press space to hit the OK button (where is my mouse pointer to click it? hehe)



The partimage returns a preview of the job to be executed, just continue normally...


And this is the screen showing the execution of the job, which does not take long.
To create an image of a 4GB system took me less than 6min, and to revert it back even less than that. Really as I expected! Kudos for partimage guys!

Note: You may notice that the images here posted are from camera-to-screen... I searched a litle bit to find a better way to do that, but it seems that the only way is to do it from a VNC from another machine, or using a virtualization technique (virtualBox for Linux is awesome)... However, my lack of time to prepare all this just for the pictures did not seem reason enough, so I just placed as they are, better than nothing, I presume.

Attachments (6)

Comments (1)

Bruno Braga - Nov 9, 2009 6:34 PM

Update: Partimage does not work yet with EXT4 filesystem (default in Ubuntu 9.10). Their website recommends use of fsarchiver instead.

 BRAGA, Bruno

 



Brazilian currently based in Japan, working on Information Technology.