PCQlinux ships two utilities partimage and rsync for backup
and restore functions.
Partimage can be used to create an image of an entire
partition. The image can subsequently be used to restore a crashed partition or
corrupted data. The Partimage utility has a client and an optional server. The
client can connect to the server and copy the image of a partition onto it.
Similarly data can be restored back from the server across the network. Needless
to say, the client can take backup and restore it from a mounted network share
|Backups on Linux is no longer a bunch of commands but a simple to use graphical utility|
PCQLinux 2006 bundles the Partimage client. Let us see how
it can be used to backup the image of a partition on a Windows share.
Backup and Restore partitions with Partimage
Assume a Windows file server running at 192.168.3.1 with a share named backups accessible to a user named backupuser with password as secret.
Create a directory named backupserver under /mnt on your
PCQLinux 2006 machine. Mount the Windows share as:
mount -t smbfs -o username=backupuser
If you are running a Linux file server, then you can NFS
(Network FileSystem) mount the server's directory.
2006 ships with Rsync for regular data backup jobs.
Rsync backs up only incremental data, saving time and network
you need to regularly (say daily) backup the data in /home/common on your
PCQLinux 2006 file server running at 192.168.3.5 to a PCQLinux backup
server at 192.168.3.6. The backup data is to be stored in the directory
/home/commonbackup on the latter server. For this, we will use rsync and
also schedule it to run daily using the cron scheduler. The rsync program
at 192.168.3.5 will connect to the backup server at 192.168.3.6 and dump
the backup data to the directory /home/commonbackup. We will refer to
192.168.3.5 as the client and 192.168.3.6 as the server.
up the backup server
“backup:secret” > /etc/rsyncd.scrt
create a file named rsyncd.conf with the following contents:
file = /etc/rsyncd.motd
read only = no
the file in the /etc directory.
start Rsync on the server issue 'ntsysv'. From amongst the list of
services, check rsync and click on Ok. Next issue:
the rsync client
-a --verbose --compress --exclude
*~ /home/common/* firstname.lastname@example.org::commonbackup
secret and backup (in email@example.com)
with the rsync user and password that you had specified above. Save the
file in the directory /etc/cron.daily and give it executable permissions
should start backing up the data from 192.168.3.5 to 192.168.3.6 everyday
at 4:02 A.M. Note that only modified data flows across the network and
that too in a compressed form. To restore data from the server, issue the
-a --verbose --compress --exclude
*~ firstname.lastname@example.org::commonbackup /home/common
Login as root. In a terminal window in KDE/GNOME or on the
Linux console, type 'partimage'. This will launch the graphical (to be precise,
a character based interface) interface of Partimage.
For “Partition to save/restore”, select the partition
which you want to backup. Note that in case of dual boot machines, you can also
backup the Windows (FAT32 and NTFS) partitions. For 'Image file to create/use',
type in /mnt/backupserver/ hostname.gz. Substitute hostname with the name of the
PCQLinux machine. Press F5. On the next screen, press F5 again. Subsequently,
type in a description for the image for example – 'image of home partition at
server.pcqlabs.net'. Select Ok. This will create the image on /mnt/backupserver
To restore from a backup, first create a partition using
say MS fdisk or Linux fdisk. Fire up partimage. Select the partition you
created. For “Image file to create/use”, type in /mnt/backupserver/
For 'Action to be done', select 'Restore partition from an
image file'. Press F5. On the subsequent screen, press F5 again. This will
restore the backed up data in the partition you selected.
The Partimage server
Instead of using a network share you can store all the images on a central server using the Partimage server called partimaged. You can download the Partimage server from ftp://fr.rpmfind.net/linux/ dag/redhat/el4/en/i386/dag/RPMS/partimage-server-0.6.4-1.2.el4.rf.i386.rpm. Install the downloaded RPM as:
Next we will need to specify which users can connect to the
Partimage server. Note that Partimage server uses system users – user swho
have account on the Linux machine. Create a user account named backupuser (say)
on the Linux machine as:
When prompted specify the password for the backupuser. The
password is required to authenticate while connecting to the Partimage server.
Next append the username i.e. backupuser to the file named partimagedusers found
in /etc/partimaged directory. Next, login as root and run the Partimage server
Let us assume that you have the Partimage server on a
machine with IP 192.168.3.2. Now from another machine, connected the network,
fire up partimage. As before, select the partition to backup. For “Image file
to create/use”, type in /var/partimaged/hostname.gz. The /var/partimaged is a
directory on 192.168.3.2 on which the images will be stored. Next, check
'Connect to the server' and fill in the IP address of the server. The subsequent
steps remain the same as above.
To restore, the steps remain almost the same. You will need
to fill in the IP address and the path to the image as /var/partimaged/hostname.gz.000.
With partimaged, you can maintain a central repository of images of all the
partitions holding critical data. Whenever you need to restore, point to the
server, select your image and done.
Hopefully, you will not need restore using partimage ever.
But if you ever do, ensure that you have a backup created.