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
too.
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
//192.168.3.1/backups /mnt/backupserver
If you are running a Linux file server, then you can NFS
(Network FileSystem) mount the server's directory.
Incremental backups |
PCQLinux Suppose, Setting echo Next motd
Save To service On export rsync Substitute chmod This rsync |
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
named hostname.gz.000
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/
hostname.gz.000.
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:
rpm -ivh
partimage-server-0.6.4-1.2.el4.rf.i386.rpm
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:
useradd backupuser
passwd backupuser
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
as:
partimaged
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.