Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Backup and Restore Linux Partitions Using Partimage

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.

Disk Archive using dar and kdar(dar Frontend)

Dar is a shell command that makes backup of a directory tree and files. Its features include splitting archives over several files, CDs, ZIPs, or floppies, compression, full or differential backups, strong encryption, proper saving and restoration of hard links and extended attributes, remote backup using pipes and external command (such as ssh), and rearrangement of the “slices” of an existing archive. It can now run commands between slices, encrypt archives, and quickly retrieve individual files from differential and full backups. Dar also has external GUI like kdar for Linux,thanks to the well documented API.

Kdar is GUI for dar.KDar is the “KDE Disk archiver”, a disk-based archiving and backup utility.KDar is built around the “disk archive library” by Denis Corbin, and is similar in function to his “DAR” program. DAR is somewhat analogous to the “tape archiver” shell command “tar”, but is better suited for backups onto disk-based media, such as CD-R’s, DVDs,Jazz, Zip, other hard-drives, etc.

KDar can perform differential backups, which means that it can quickly store the differences between a recent full backup and the current state of your data.KDar now supports strong encryption based on the blowfish algorithm.

Install dar and kdar in Ubuntu

For dapper Users

sudo apt-get install dar kdar

For Edgy Users

sudo apt-get install dar kdar

kdar Edgy Problem with Solution

When you try to install kdar you will get the following error

The following packages have unmet dependencies.
kdar: Depends: libdar3c2a but it is not installable E: Broken packages

Solution1

If you are seeing the above error you need to download libdar3c2a from dapper packages and install this package.

Solution2

You can also use the following procedure when you do this you need to be very careful what you are doing.

you can edit the /etc/apt/sources.list file

sudo vi /etc/apt/sources.list

add the following line

deb http://gb.archive.ubuntu.com/ubuntu/ dapper universe

save and exit the file.

Now update the souce list using the following command

sudo apt-get update

Install libdar3c2a from dapper packages using the following command

sudo apt-get install libdar3c2a

Once this finished the installation you need to remove the line we have added in /etc/apt/sources.list for dapper save the file and exit

Now you need to update the source list using the following command

sudo apt-get update

This will complete the installation now if you want to open the application go to Applications—>Accessories—>KDar
(Disk-Based Archive Tool)

Once it opens you should see the following screen here select basic setup and click on next

Here if you want to use KDE Wallet to store your password enable this otherwise click on finish

Now you need to define where you want to archive directory and click ok

If that directory you choose doesn’t exist it will create for you select yes


Dar is Loading

Once it opens the complete application you should see the following screen this is kdar main screen.Below the titlebar are KDar’s Menubar and Toolbar. The Menubar allows you to open and create archives, operate on them, and get information about KDar. The Toolbar gives you one-click access to many of KDar’s features, and you can configure it to your liking by right-clicking on it.

Creating archives Using KDar

To create an archive, select “Archive->Create” (at bottom of menu).

Let the wizard take you step-by-step through the archiving process. Use the Next > and <>

The first page of the create wizard gives you an opportunity to restore a “profile”. Profiles store all of the information needed to perform one of KDar's operations. You save them to your filesystem as regular files, with any name you like, ending with “.kdar”. Currently KDar supports “creation” and “restoration” profiles.

To load a creation profile, click the Restore profile button and select the profile. You probably haven't saved a profile yet, so just click the Next > button.

Now you need to enter the archive name and you can choose your choice of name but recommended one is descriptive you can see this in the following screen

The “root directory” is the filesystem’s top-level directory that you want to archive. KDar will consider all directories and files below this directory for inclusion in the archive, but no files above or adjacent to this directory.Here Choose the archive’s root directory.

Creating full system backups can take several hours on modern filesystems. KDar can optionally store the difference between the current state of the filesystem and the state of the filesystem when you last created a full backup. The
new archive is called a “differential” archive. Performing a differential backup can take considerably less time than doing a full backup, and the resulting archive usually takes up much less space on your filesystem or storage media.

If you want to make a differential backup, enable the differential backup checkbox, and select the reference archive.
The reference archive can be from a previous full backup, a previous differential backup, or an archive catalog. Archive catalogs contain only the basic archive information, such as the contents, but are equivalent to regular archives as far as differential creation is concerned.

Leave the checkbox unchecked if you’re making a new archive (e.g., a full backup).

KDar has many advanced creation features which you can configure by clicking the Configure creation options button.You can see the advanced configuration options screen as follows.This brings up a configuration dialog which allows you to customize the creation process to suit your needs. For example, KDar has powerful directory and file filtering mechanisms which allow you to fine-tune which directories and files to include in the archive. You can also choose whether to compress the archive contents, and you can specify which types of file to exclude from the compression process. KDar now supports strong encryption, and you can enable it there.If you want to use advanced options Configure the advanced creation settings.

Now you can save your settings as a profile.When you’re satisfied that everything is okay, click Finish.

Your archive should be created. KDar will show you a progress dialog which displays the percentage of files processed,the media type and current archive slice size. Filenames are also displayed as they are added to the archive.

Restoring archives Using KDar

Select “Archive->Restore”

You should see the following screen

Here you need to select the archive you want to open select .1.dar and click on open

Now you need to choose a directory to extract your archive into and click on folder icon to choose a directory

You should see similar to the following screen select a directory to extract your archive and click ok

Once you selected restore directory you should see the following screen and click ok

It will start the restore process you can see this in the following screen

This will restore all the files you have selected for restore.This is very simple and useful backup tool for all ubuntu users and admin.

If you want more documentation about kdar check here and if you want to use dar from command line check dar documentation here