|
|
What is the RsyncBackup utility and how do I use it? |
| Applies to: NetMAX RsyncBackup (discontinued)
| |
RsyncBackup:Purpose:This document explains the purpose of RsyncBackup and the steps that an administrator must follow to use it.Prerequisites:This document assumes the following:
Obtaining A License
Purchase the license code for the RsyncBackup
package from the NetMAX
Store . Once you
have received the license code, in the NetMAX interface of the server
on which the RsyncBackup package will be installed, access
HOME|System|License Management. OverviewRsyncBackup is a utility that allows a NetMAX administrator to clone NetMAX system disks or volumes for the purpose of recovery in cases of disk failure or data corruption. The RsyncBackup utility requires an experienced administrator to:
Downloading and Installing the RsyncBackup utility package
Preparing storage space for a NetMAX backupPreparation for use of the RsyncBackup utility requires a NetMAX administrator to acquire, install, and configure storage hardware that is identical to the storage hardware that he/she wishes to backup. The NetMAX administrator must determine the storage capacity of the disks on the source NetMAX system using the fdisk command on each disk that he/she intends to backup. For example, if the NetMAX administrator intends to backup disk /dev/hda he/she would execute the following to attain disk parameters for disk /dev/hda:fdisk -u -l /dev/hda The administrator would then configure an identical disk on the backup system and configure the disk using the disk parameters attained via the execution of the fdisk command on the NetMAX system that we intend to backup. The first step in disk configuration is disk partitioning. For example, if disk /dev/hde was designated to be the backup disk, the NetMAX administrator would execute the following fdisk command to begin the partitioning process:fdisk -u /dev/hde Execution of the above command will initiate interaction with fdisk. Proceed and respond as described below:
Add a new partition (/dev/hde1):
>> choose "n" (new partition)
>> choose "p" (primary partition)
>> choose "1" (partition number)
>> first sector - (see fdisk info from NetMAX disk /dev/hda)
>> last sector - (see fdisk info from NetMAX disk /dev/hda)
Now create a second extended partition (/dev/hde2)
>> choose "n" (new partition)
>> choose "e" (extended partition)
>> choose "2" (partition number)
>> first sector - (see fdisk info from NetMAX disk /dev/hda)
>> last sector (see fdisk info from NetMAX disk /dev/hda)
Now create a logical partiton within the extended partition (/dev/hde5)
>> choose "n" (new partition)
>> choose "l" (logical partition)
>> first sector - (see fdisk info from NetMAX disk /dev/hda)
>> last sector - see fdisk info from NetMAX disk /dev/hda, double the Blocks info from hda5,
so if hda is 102368, then enter 204736.
Now create the last logical partition (/dev/hde6)
>> choose "n" (new partition)
>> choose "l" (logical partition)
>> first sector - (see fdisk info from NetMAX disk /dev/hda)
>> last sector - (see fdisk info from NetMAX disk /dev/hda)
Now fix the partiton type on /dev/hde5
>> choose "t" (type)
>> choose "5" (partition number)
>> choose "82" (hex code for Linux Swap)
Print out the partition table, does it look correct
>> choose "p"
Now write out the partition info
>> choose "w"
The backup disk is now partitioned and needs to be formatted and labeled. Execute the following steps at the UNIX command prompt to accomoplish this:
> mke2fs /dev/hde1 (this will be the root disk "/")
> mke2fs /dev/hde6 (this will make the var disk "/var")
> mkswap /dev/hde5 (this will make the swap partition)
> e2label /dev/hde1 "NETMAX"
> e2label /dev/hde6 "www" (if the name of the machine that has
/dev/hda is "www.netmax.com")
The hde6 label is important because it is used in the future to associate the disk with a backup specification entry within the RsyncBackupConfig file. Therefore, it is important to give it a meaningful name to distinguish it from other backup disks. See the next section ("Specifying source and destination parameters") for more information about the use of this label.The final step of backup disk preparation is making the backup storage space available. Backup disk partitions must be mounted to a mount point named after the disk (ex. sdc, sdd,) at the mount location (ex. /var/mnt) specified by the basepath in the RsyncBackupConfig file (See the "Specifying source and destination parameters" section for more information). The admin must create the "dirs" (as specified in the RsyncBackupConfig file) in the device path (ex. /var/mnt/sdb) to backup to. So, it is recommended that if for example sdb1 is supposed to backup sda1 on the source system, and sda1 is /, then you should mount sdb1 to to / rooted at /var/mnt/sdb on the local (backup) system. And if sdb6 is supposed to backup sda6 on the source system, and sda6 is /var, then you should mount sdb6 to /var/mnt/sdb/var on the local (backup) system. The goal being that in the end, the backup storage configuration looks identical to the source disk. The NetMAX administrator must repeat the entire storage preparation process for all disks on the NetMAX system that he/she wishes to backup. Specifying source and destination parametersThe RsyncBackup installation process installs a sample configuration file named "RsyncBackupConfig" in /usr/netmax/rsyncbackup. This file is a text file, and can be modified or replaced to represent the backup process that you wish to execute. The RsyncBackupConfig file supports multiple backup specification entries. The format of each entry within this file is as follows:
[local]
disks=<list of comma separated backup disk device names>
basepath=<base path of backup "disks" mount points>
[<label of partition 6 of backup disk 1>]
fqdn=<FQDN of source machine with disk that you want to backup>
targets=<Comma separated names of targets that you want to backup>
dirs=<Comma separated names of backup directories. Order corresponds to target specification>
options=<rsync options>
lilo=<yes/no backup lilo>
[<label of partition 6 of backup disk 2>]
.
.
.
.
Note: "targets" must be registered with the backup target machine via rsyncd.conf. See the next section (Configuring the backup source machine to allow a rsync backup) for further details.
The RsyncBackup utility processes disk backups in the order that they appear in the "disks" list. When processing each disk in "disks" list, the RsyncBackupScript looks at the partition 6 label of the disk to determine which backup specification entry to use when performing a backup to the disk. Therefore, it is very important that the labels assigned to the 6th partition of each backup disk correlates to a label of a backup specification within the RsyncBackupConfig file. An example of a RsyncBackupConfig file entry follows:
[local]
disks=sdb
basepath=/var/mnt
[test]
fqdn=rsync.test.com
targets=var,root
dirs=/var,/
options=-alHpDx
lilo=yes
The example specifies that the backup disk with partition 6 labeled as "www" will store a backup of the target "var" in the local directory " Configuring the backup source machine to allow a rsync backupThe source machine has to be configured to support rsync backups. "targets", as defined in the RsyncBackupConfig file must be defined within the rsyncd.conf. An example of an /etc/rsyncd.conf file follows:
log file = /var/log/rsyncd
pid file = /var/run/rsyncd.conf
[var]
path = /var
read only = true
uid = 0
gid = 0
dont compress = *.gz *.tgz *.zip *.z *.rpm *.jpg *.gif *.mpg *.JPG *.GIF *.mpeg *.mp3
hosts allow = 192.168.33.77
[root]
path = /
read only = true
uid = 0
gid = 0
dont compress = *.gz *.tgz *.zip *.z *.rpm *.jpg *.gif *.mpg *.JPG *.GIF *.mpeg *.mp3
hosts allow = 192.168.33.77
See the man page for rsyncd.conf for further information.
Note that xinetd must also be configured to enable the rsync server. This can be done by simply editing the /etc/xinetd.d/rsync and changing "disable=yes" to "disable=no". After you enable the rsync server, you must restart xinetd by issuing a "kill -HUP" on its process id.
You must also add a .rhosts entry for root from the backup machine on each machine to be backed up
Executing the RsyncBackup utility
The RsyncBackup utility is run by simply executing /usr/netmax/rsyncbackup/RsyncBackup. Administrators may want to create a cron entry for RsyncBackup to schedule repeated execution. See the man page for cron for implementation information.
Recovering from failure or data corruption using your backupsSimply replace the corrupted drive with the backup drive. | |
| address-suppressed |
| ||||||||