Debian Admin - Your way to Debian World

December 31, 2006

Backup and Restore Linux Partitions Using Partimage

by @ 9:15 am. Filed under Backup

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Partition Image is a Linux/UNIX utility which saves partitions in many formats (see below) to an image file. The image file can be compressed in the GZIP/BZIP2 formats to save disk space, and split into multiple files to be copied on removable floppies (ZIP for example), … Partitions can be saved across the network since version 0.6.0.When using Partimage, the partitions must be unmounted.

Partimage is veryuseful in the following situations

First you can restore your linux partition if there is a problem (virus, file system errors, manipulation error) . When you have a problem, you just have to restore the partition, and after 10 minutes, you have the original partition. You can write the image to a CD-R if you don’t want the image to use hard-disk space.

This utility can be used to install many identical computers. For example, if you buy 50 PCs, with the same hardware, and you want to install the same linux systems on all 50 PCs, you will save a lot of time. Indeed, you just have to install on the first PC and create an image from it. For the 49 others, you can use the image file and Partition Image’s restore function.

Supported file systems

ext2fs/ext3fs,Reiser3,FAT16/32,NTFS,HPFS,JFS,XFS,UFS(beta),HFS(beta)

Install Partimage in Ubuntu

First you need to make sure in your /etc/apt/sources.list file universe source list is enabled.

sudo apt-get install partimage

Install Partimage in Debian

#apt-get install partimage

This will complete the installation now

Before starting application you can check the all the available partitions using the following command

For Ubuntu Users

sudo fdisk -l

For debian users

#fdisk -l

Backup Partition

if you want to run the application use the following command

For Ubuntu Users

sudo partimage

For debian users

#partimage

Once it opens the application you should see similar to the following screen

Once you launch PartImage, use the Up and Down arrows to select which partition to back up.

Type the name of the path and file where you’re going to back up the partition.In this example I mounted the backup partition at /backup, I have to type /backup/serverbackup and not just serverbackup.

Action to be done should be Save partition into a new image file.

On the next screen, use no compression if you want the backup to be quicker. You really should use the Gzip or Bzip2 options only if your external hard drive or other backup partition is too small to hold the contents of the partition you’re backing up.

Now you should remember that the backup will save only the used space on the partition.So, if you have a 100 GB partition you’re backing up and only 11 GB of it is used, the partition image will be only 11 GB.

Now you press F5 to Continue for next screen here you need to enter a description of the save partition.

After PartImage examines the partition data for a while, it’ll give a summary of the partition.Here select ok and press enter

PartImage will start saving your partition to an image file on the backup partition and you can see the progress in the following screen.

Now you can see in the following screen backup partition operation completed successfully.

Then, you’ll be back to the terminal prompt.

Restore Partition

if you want to run the application use the following command

For Ubuntu Users

sudo partimage

For debian users

#partimage

Once it opens the application you should see similar to the following screen here you need to select the partition to restore,image file to use in my case i have saved my partition image file as serverbackup.000 if you want to menction .img extension at the time of backup it will save as .img file otherwise it will save as .000 extension,select restore partition from an image file option under action to be done select F5 for next screen

You should see the following screen select ok and press enter

Now you should see the following screen here you need to select the options The only extra option you can choose is Erase free blocks with zero values. If this option is enabled, all blocks which are not used are erased with zero bytes. This may be useful if you want to be sure that the data which were on the partition before this operation are fully erased. If this option is disabled, old data which was on currently unused blocks can be accessed (with some difficulty), because nothing is written on these blocks. These old data can be read with tools such as dd (GNU convert and copy) and press F5 to continue.

The partition to restore must have the same size as the saved partition. If the partition is smaller than the original one, the operation will fail. If it is bigger, space can be lost.
Now you should see the summary of restore partition information select ok and press enter

Confirm the image file you want to restore

Restore partition from an image file is in progress

Restore partition from an image file is completed successfully completed select ok and press enter Then, you’ll be back to the terminal prompt.

Tags: , , , , , , , , , ,

You may also be interested in...

10 Responses to “Backup and Restore Linux Partitions Using Partimage”

  1. sureinlux Says:

    Apparently the Partimage fro amd64 under Egdy Eft Ubuntu does not work (a filed bug # 19124) site:https://launchpad.net/distros/ubuntu/+bug/19124

  2. HackITLinux Says:

    Backing up a partition…

    We all know the importance of backing up your data. Most of the time, we back up files and subdirectories into tapes, optical media, network-attached storage devices, storage area network and/or a spare hard drive. There are instances, however, that……

  3. Whitney Says:

    Just noticed that my home page needed correcting. Cheers, Dan.

  4. Ernie Says:

    There is also the System Rescue CD. You can download the .iso image from here then burn it to CD. It creates (as the name implies) a bootable rescue disk.

    System Rescue CD uses Partimage to create partition images, and includes many other system rescue utilities too. The link above takes you to the main page of System Rescue CD where you can learn more :) .

  5. fede Says:

    Hi,i would like to backup the root partition,but it refuse because is mounted.Can help me?

  6. Nick Says:

    Fede
    you have to unmount before you can use partimage. I suggest booting from a live cd

  7. Linux Disaster Recovery Software Says:

    Thanks for the useful information. It really helps

  8. Jerry Says:

    Hi Admin,

    Is there a way that I could automate the backup through scheduling Partimage?

    Thank you.

  9. Jerry Says:

    Hi Admin,

    Please ignore the question I have posted earlier.

  10. teak Says:

    hi…
    i tried this…
    but when i go to reboot after restoration, i get a black screen with:

    GRUB _

    in the top left…

    i rebooted with systemrescuecd looked in the grub devices.map and the harddisc was pointing to my disc /dev/sda…
    ive tried getting aroud this for the past two days…
    ive looked around online to no avail…
    can any one help me?

    thanks…

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

WidgetBucks - Trend Watch - WidgetBucks.com

Related Links:


WidgetBucks - Trend Watch - WidgetBucks.com

Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.