(Answer) (Category) NetMAXFAQ : (Category) Certified NetMAX Addon Packages : (Category) RsyncBackup - NetMAX system backup utility :
What is the RsyncBackup utility and how do I use it?
Applies to: NetMAX RsyncBackup (discontinued)
What is the RsyncBackup utility and how do I use it?

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:
  • The reader is executing the procedure herein on a supported platform, as defined here.
  • The person performing this procedure can log into the source and backup NetMAX systems as the administrative user.
  • The person performing this procedure is experienced with general UNIX system administration.
  • The person performing this procedure is familiar with the basics of operating a NetMAX server, as outlined in the NetMAX Server Manual.

Obtaining A License

Purchase the license code for the RsyncBackup package from the NetMAX Store .
The proper procedure for making a purchase through the NetMAX Store is to log in with your Store userid and password, before making any purchases.
If you do not currently have an account on the NetMAX store,create one and log in before purchasing the license code. These steps are necessary so that Cybernet Systems can more easily assist you in the future if there is a question regarding NetMAX products you have purchased.
The license code can be found by typing the word rsyncbackup into the search box in the upper left of the NetMAX Store.
Follow the normal procedure to purchase the license code, which will be sent via email to the location specified in the NetMAX Store account.

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.
In the Currently Installed License numbers table, enter the license code from the last few steps, but do not click the “+” icon yet.
Note the Registration Activation Key in the lower left of the table.
Keep the license management window open, and a new browser window.,
In this new browser window access NetMAX online registration .
Login and register the license number, using the Registration Activation Key noted earlier.On the resultant page, the Registration Code for your NetMAX RsyncBackup license
number is displayed. Enter this Registration Code into the NetMAX window you kept open earlier, to the right of the new license number.
Click the “+” icon to add the new license number and registration code to your NetMAX.
Click the APPROVE button.
Click the COMMIT ALL button and wait for the commit.

Overview

RsyncBackup 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:
  • Download and install the RsyncBackup utility files.
  • Prepare storage space for the NetMAX backup.
  • Specify source and destination parameters.
  • Configure the backup target machine to allow rsync backups.
  • Execute the RsyncBackup utility (manually or automatically).
  • Recover from disk failure or data corruption by swapping the backup disks for their originals.

Downloading and Installing the RsyncBackup utility package

  1. Access the NetMAX Package Manager. (HOME|System|Package Management)
  2. Click the ADD button.
  3. Ensure that is FTP is selected for Mode.
  4. Click the DOWNLOAD INDEX button to ensure you have the latest list of packages.
  5. Once the Index download has finished, select the entry NetMAX/Addons from the Index of Categories pulldown menu.
  6. Install the following packages:

    RsyncBackup-1.0-4.02.0.i386.rpm

The RsyncBackup utility package will install all RsyncBackup utility script files and a configuration template file in /usr/netmax/rsyncbackup.

Preparing storage space for a NetMAX backup

Preparation 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 parameters

The 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 "/var" and target "root" in the local directory "/". It also specifies that rsync will be run with the options "-alHpDx" and that lilo will be setup on the backup disk. The options "-alHpDx" are the default options used by RsyncBackup if you do not specify your own options. The default options work well for typical NetMAX system backups. The options field allows you to override these options.

Configuring the backup source machine to allow a rsync backup

The 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 backups

Simply replace the corrupted drive with the backup drive.
address-suppressed
This document is: http://www.netmax.org/cgi-bin/fom.cgi?file=503
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by ...Cybernet Systems Corp.