disk backup

Upload: matthew-feagins

Post on 07-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Disk Backup

    1/42

    PBX IN A FLASH DEVELOPMENT CORPORATION

    Whole Disk Backup

    Backing up your PBX in a Flash 1.7.5.5installation

    PIAF Development Corporation

    March 25, 2011

    A manual to install, configure, and use a whole disk backup program on PBX in a Flash 1.7.5.5

    PIAF De

    CorpDigitally signed by PIAF Dev

    DN: cn=PIAF Dev Corp, o=P

    Flash Development Corpora

    ou=Executive,

    email=support@piafdevcorc=US

    Date: 2011.03.25 11:21:00 -0

  • 8/6/2019 Disk Backup

    2/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 2

    Welcome! This document will describe the configuration and installation of the whole disk backup

    package onto PBX in a Flash 1.7.5.5 We have tested this script on Lab, Production, Real, and Virtual

    machines; using both VMware and Proxmox with great success. This is version 1.7.5.5 of the program

    released March 25, 2011

    WARNINGS

    This script was tested and vetted on machines running INTEL and AMD processors with lots of RAM

    and NO SATA or RAID controllers present. All of the machines used in the development of this

    program use SATA or Virtual drives. LVM drives were not used for testing and are not recommend for

    use with this program. If you want to run this on a machine that uses either RAID or LVM there is No

    direct support available except from the authors of Mondo.

    As with any new piece of software you need to ensure it actually works in your own computer

    environment. If you fail to test this software on your production machine and you rely on it to do

    mission critical backups YOUR BACKUP OR RESTORE WILL FAIL. What does this mean? It means that

    without testing on your own hardware the Whole Disk Backup program may not work at all.

    This work is copyright 2007 2011 by the PBX in a Flash Development Corporation. This work may

    not be altered or modified without express written permission of the author. You may copy this

    manual and use it freely; however this notice must be included with the document. This manual is

    NOT released under the GNU General Public License. Whole Disk Backup is designed and licensed

    to only run under PBX in a Flash. Use of this program under any other PBX system is a violation of

    our license.

    Please contact us in the PBX in a Flash forum for further information.

  • 8/6/2019 Disk Backup

    3/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 3

    The need to have mission critical backups for PBX in a Flash 1.7.5.5 is a requirement that has been

    lacking in most installations of PBX systems. When a PBX installation fails due to hardware problems

    there has to be a way to quickly and accurately restore the system. The hard disk backup should be able

    to take an entire hard drive and all partitions and store it on a remote site. The stored hard

    drive/partition information should be able to be easily restored to a bare metal environment.

    OVERVIEW

    In order to meet this need Mondoarchive was chosen as the backup engine. It provides complete hard

    drive/partition backups to multiple media types. Mondoarchive also supports most file systems and has

    a facility to boot the restore software from different media and restore it. The best part is Mondo is

    free! More information can be found at http://www.mondorescue.org. Below is an excerpt from the

    Mondo website.

    Mondo is reliable. It backs up your GNU/Linux server or workstation to tape, CD-R, CD-

    RW, DVD-R[W], DVD+R[W], NFS or hard disk partition. In the event of catastrophic data

    loss, you will be able to restore all of your data [or as much as you want], from bare metal if

    necessary. Mondo is in use by Lockheed-Martin, Nortel Networks, Siemens, HP, IBM,

    NASA's JPL, the US Dept of Agriculture, dozens of smaller companies, and tens of

    thousands of users.

    Mondo is comprehensive. Mondo supports LVM 1/2, RAID, ext2, ext3, JFS, XFS,

    ReiserFS, VFAT, UFS, and can support additional filesystems easily: just e-mail themailing

    listwith your request. It supports software raid as well as most hardware raid controllers. It

    supports adjustments in disk geometry, including migration from non-RAID to RAID.Mondo runs on all major Linux distributions (RedHat, RHEL, SuSE, SLES, Mandriva,

    Debian, Gentoo) and is getting better all the time. You may even use it to backup non-Linux

    partitions, such as NTFS.

    http://www.mondorescue.org/http://www.mondorescue.org/http://www.mondorescue.org/http://www.mondorescue.org/support.shtmlhttp://www.mondorescue.org/support.shtmlhttp://www.mondorescue.org/support.shtmlhttp://www.mondorescue.org/support.shtmlhttp://www.mondorescue.org/support.shtmlhttp://www.mondorescue.org/support.shtmlhttp://www.mondorescue.org/
  • 8/6/2019 Disk Backup

    4/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 4

    Using a program based cron job Mondoarchive is called to backup all of the hard drives and partitions on

    your PBX in a Flash 1.7.5.5 system. Mondoarchive will generate a number of ISO based files that

    represent all of the information on your hard drives and partitions. An ISO based file is one that is

    designed to be written to a cdrom or dvd media. The writing of these ISO files can be accomplished by

    any CD/DVD writing software. Nero Burning is one example that primarily runs under windows.

    METHODOLOGY

    The ISO files are sequentially numbered 1 n and there is a separate ISO created called

    emergencyboot.iso. The emergencyboot.iso file is an emergency boot disk which contains a copy of the

    boot information and the restore software. This disk can be used if booting off of the first disk of your

    mondorescue-n.iso fails. All of these files are created on the local hard drive of your PBX in a Flash

    1.7.5.5 system. Once the files have been created you must store them offsite in case of a catastrophic

    failure.

    This is where the disk-backup.cron program comes into play. The program, under control of cron, and is

    invoked once a week. Once disk-backup.cron has completed the creation of the ISO files it will move the

    files to offsite storage. The methods by which the files can be moved are ftp, direct copy to an attached

    USB hard or flash drive, via SMB connection, or to a network attached PogoPlug. Mondoarchive also

    directly supports copying the ISO files directly to an attached NFS share point. I have not implemented

    NFS as there seems to be little demand for it. If the reader wants this feature I would recommend they

    read the Mondo documentation.

    There are several requirements to run the disk backup script and they are outlined below. It isrecommended you have met all of the requirements prior to performing the installation and

    configuration.

    REQUIREMENTS

    o A working PBX in a Flash 1.7.5.5 installation. Note this software is designed to work with PBX in aFlash 1.7.5.5 ONLY

    o A command line editor you are comfortable with on your PBX in a Flash. We use joe as ourcommand line editor.

    o Various pieces of information that you will require in order to make the file transfer methodsyou have selected work. Below is a table of all of the required information. Simply fill theinformation for the method of storage you have selected. By default ftp is enabled and

    USB/SMB is disabled.

  • 8/6/2019 Disk Backup

    5/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 5

    A least one of the following

    o An ftp account on a remote system that you can log into and upload fileso A USB stick of sufficient size locally attached to your PBX in a Flash. It is recommended you

    follow the directions in Appendix one to delete the existing file system and redo it with the Linux

    version of fdisk and mkfs.

    o Access to a shared drive on a Windows/Samba server with sufficient privileges to read and writefiles

    o Access to a Pogo Plug share

    These settings are contained in /etc/pbx/disk-backup.conf and /etc/pbx/script-email.conf. When the

    program is installed the default setting is to disable the production of ISO backups until the

    /etc/pbx/disk-backup.conf file is fully configured.

    Information Tables to be filled out prior to Installation

    Program Options

    VARIABLE

    NAMEDefault Value

    User provided

    valueDescription

    CONFIGURED 0

    MASTER SWITCH This controls if the program is

    processed.

    0 = DISABLED You need to change this to 1 after you

    have configured the /etc/pbx/disk-backup.conf file

  • 8/6/2019 Disk Backup

    6/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 6

    Configuration Options

    VARIABLENAME

    Default Value User providedvalue

    Description

    REMLOGS 1

    This switch tells the program to remove the log files

    from the previous weeks run

    0 = Do not remove previous log files

    1= Do remove previous log files

    SENDLOG 1

    This switch instructs the program to email the log file

    to a email address specified in /etc/pbx/email-

    script.conf There is another option later in the

    configuration file to gzip the log file prior to sending

    it.

    0 = Do not email log

    1 = Email log

    DELBACKUPS 1

    This option causes the ISO files that have been

    created to be deleted AFTER they have been copied

    to offsite storage.

    0 = Do not delete local copy of ISO file

    1 = Delete local copy of file

    DIRECTORY /backup Do not change! This is where the ISO files are created.

  • 8/6/2019 Disk Backup

    7/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 7

    Mondorescue Configuration

    VARIABLENAME

    Default Value User providedvalue

    Description

    EXCLUDEDIR /backup

    This entry tells Mondorescue which directories to

    exclude during backup. The /backup directory is

    created by the whole disk backup installation

    program and is where the local copy of ISO files

    resides if they are not deleted after processing. You

    may add other directories by simply adding a space

    and a properly formatted unix path

    MFILESIZE 4300m

    This tells Mondorescue how big an ISO to create. It is

    recommended that this size be slightly smaller than

    CD or DVD size. CD size should be 630m and single

    layer DVD should be 4300m. The m after the

    number = megabytes and is NOT optional!

  • 8/6/2019 Disk Backup

    8/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 8

    Ftp Information

    VARIABLE NAME Default ValueUser

    provided

    value

    Description

    CPFTP 0

    Once the ISOs have been created by

    Mondorescue copy them to an ftp store

    0 = Do not copy to ftp share

    1 = Copy to ftp share

    USERNAME ftpuserThis is the username that you use to log onto

    the remote ftp server

    PASSWORD ftppasswordThis is the password used to log onto the

    remote ftp server

    REMOTEDIRECTORY /This is the remote ftp directory you wish the

    backup files to be placed minimum is /

    SERVER ftp.server.ipThis is the IP address or Fully Qualified Domain

    Name of the ftp server

  • 8/6/2019 Disk Backup

    9/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 9

    Usb drive info

    VARIABLE NAME Default Value User providedvalue

    Description

    CPFLASH 0

    Once the ISOs have been created by

    Mondorescue copy them to an external

    USB Hard/Flash drive

    0 = Do not copy to USB hard/flash drive

    1 = Copy to USB hard/flash drive

    USBMOUNTPOINT= /mnt/usbmondoWhere the flashdrive is mounted to

    default is /mnt/usbmondo

    It is

    recommended

    you DO NOT

    change this

    USBDEVICENAME= /dev/sda1

    This is the device name of your USB

    stick and may change depending on

    what you find using dmesg. Default is

    /dev/sda1 *Usually works in most

    cases

    Please see Appendix one for the complete procedure to configure your USB drive to work before fillingout the table above.

  • 8/6/2019 Disk Backup

    10/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 10

    Smb Share Information

    VARIABLE NAME Default Value User providedvalue

    Description

    CPSMB 0

    Once the ISOs have been created by

    Mondorescue copy them to a SMB share

    on the network

    0 = Do not copy to network share

    1 = Copy to network share

    SMBMACHINE= 192.168.1.5

    This is the ip Address of the machine

    that is sharing a folder. This machine can

    be windows based or any operating

    system that can run SAMBA server

    SMBSHARE= sharename

    This is the share name on the remote

    window/Samba machine. NOTE you

    must have sufficient privileges on the

    remote machine to read/write/modify

    LOCALMOUNT= /mnt/smbmondo

    This is the local folder that the remote

    SMB share is mounted to. NOTE dont

    change thus unless you understand how.

    It is

    recommendedyou DO NOT

    CHANGE THIS!

    SMBUSER= userThis is your username on the remote

    Windows/Samba machine

    SMBPASS= passThis is your password on the remote

    Windows/Samba machine.

  • 8/6/2019 Disk Backup

    11/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 11

    VARIABLE NAME

    Pogo Plug Information

    Default ValueUser provided

    valueDescription

    CPPOGO 0

    Once the ISOs have been created by

    Mondorescue copy them to a

    network based Pogo Plug

    0 = Do not copy to the Pogo Plug

    1 = Copy to the Pogo Plug

    PMOUNT "/mnt/pogoplug"

    This is the local mount for Pogo Plug

    It is recommended you do NOT

    change this

    PNAME "[email protected]"

    This is the username to log into a

    Pogo Plug. Note it should be in the

    form of an email address

    PPASS "password"

    This is password used in conjunction

    with username to log into a Pogo

    Plug

    POGOROOT "16gbflash"

    This is the name of the hard drive on

    the Pogo Plug you wish to use. NOTE

    it is recommended you change the

    name of the shared hard drive to

    something without spaces in it.

    Spaces in the hard drive name can

    lead to unexpected results. This can

    be changed on the web based

    configuration # my.pogoplug.com

    POGOPATH "test 15"

    This is the destination directory on

    the Pogo Plug. If it does not exist itwill be created. We tested it with a

    space in the name however it is

    recommended you do NOT use

    spaces or any special charaters in

    the directory name

  • 8/6/2019 Disk Backup

    12/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 12

    Rsync information

    VARIABLE NAME Default ValueUser provided

    valueDescription

    USYNC 0

    This will allow the ISO files to be copied

    to the destination via rsync. Generally

    this takes less time to do the copy,

    except for the first iteration. After the

    first time only the deltas (changes) are

    copied to the remote storage device.

    If enabled it will be used on all enabled

    methods except for ftp.

    0 = Do not use rsync

    1 = Use rsync

    Gzip information

    VARIABLE NAME Default ValueUser provided

    valueDescription

    GZIPPEE 0

    With this option gzip will compress thelog file prior to emailing it to the

    designated recipient. The log files can

    become very large and be rejected by

    mail servers. This is only effective if

    sending of logs via email is enabled (as

    above)

  • 8/6/2019 Disk Backup

    13/42

  • 8/6/2019 Disk Backup

    14/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 14

    In order to install disk-backup.cron and its associated programs the user will have to follow some basic

    commands in the PBX in a Flash 1.7.5.5 command line interface. (Hereinafter called the CLI) This

    document contains screen captures and step by step instructions so the installation should not present

    too many difficulties.

    PROCEDURE

    The general order of installation is as follows:

    1. Decide which method(s) you will be using to transfer your backup files and to which remotemachines or attached devices. You may choose one or all of them. By default ftp is enabled but

    you can also choose to use USB hard/flash drive, SMB, or Pogo Plug.

    2. Fill out the information tables above prior to installing the software. If you are going to use aUSB memory stick I recommend it be at least 8gb in size. You will need to follow the steps in

    Appendix 1 in order to get the required information to fill out the table above.

    3. Install the Software4. Configure the /etc/pbx/disk-backup.conf file.5. Test the backup software by running the disk-backup.cron script by hand. This will take a very

    long time. Start it running and go away for lunch!

    Please log onto your PBX in a Flash 1.7.5.5 system as root and perform the following steps

    INSTALLING THE SOFTWARE

    STEP 1

    Type help-pbx and then tap the ENTER key

    As you scroll through it you will see on page 3 the new install-diskbackup program

  • 8/6/2019 Disk Backup

    15/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 15

  • 8/6/2019 Disk Backup

    16/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 16

    STEP 2

    Type install-diskbackup and then tap the ENTER key. You will see out standard license screen tap the Y

    key to agree with the terms and continue

    STEP 3

    You will see a short message about checking for LVM. If you are running LVM you will see the following

    warning

    If you are not running LVM you will see the following

  • 8/6/2019 Disk Backup

    17/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 17

    You might see the following screen if the mail configuration file is not present on the system

    STEP 4

    Next you will see the download screen

    If the download is successful you will see the install proceed. If your internet is down you will see the

    following

  • 8/6/2019 Disk Backup

    18/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 18

    Then

    If you see these screens you have problems with your internet connectivity. It is your problem to

    diagnose this and not the developers of PBX in a Flash!

    STEP 5

    As the install progresses you will see the following screens:

  • 8/6/2019 Disk Backup

    19/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 19

    Step 6

    You will be given the option to view the installation log file

  • 8/6/2019 Disk Backup

    20/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 20

    The screen will look similar to the following:

    Other screens that may be displayed

    If you see this screen it means you are trying to run this program on a non PBX in a Flash 1.7.5.5

    installation or you are trying to run it on a pre PBX in a Flash 1.7.5.5 install. Unfortunately older installs

    of PIAF are incompatible with the new version of the program. If you are running an older version of

    PIAF please use the deprecated version as it still works. There are NO plans to back port this version so it

    runs in versions prior to 1.7.5.5

  • 8/6/2019 Disk Backup

    21/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 21

    We need to edit the /etc/pbx/disk-backup.conf file and add the appropriate information. We

    recommend the use joe for this purpose. It is a powerful text editor and allows you to use WordStar

    commands . All of the following screen captures are show inside of the joe editor environment.

    Configuring the disk-backup.conf file

    Log into your PBX in a Flash 1.7.5.5 system as root and in the CLI type cd /etc/pbx and tap the ENTER

    key. Now type joe disk-backup.conf and then tap the ENTER key. You should see the screen below.

    A few notes about the disk-backup.conf

    The can be no blank lines! Comments always start with a # symbol All options MUST be enclosed by double quotes for example: 1 There are NO capital Os as options only Zeros 0

    1. The first thing to edit is the master switch. This controls if the conf file is processed. It is shipped OFF

  • 8/6/2019 Disk Backup

    22/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 22

    2. Next we edit the configuration options

    We recommend you use the defaults

    3. Mondoarchive configuration There are only 2 options at the moment: EXCLUDEDIR and MFILESIZE.EXCLUDEDIR is the command line portion that tells Mondoarchive which directories NOT to back up.

    At a minimum /backup MUST BE INCLUDED. If you wish to add other directories simply add the full

    path after the /backup with a space between each directory path.

    MFILESIZE is the command line portion that tells Mondoarchive how big an ISO to make. We

    recommend either 630m for CDrom or 4300m for DVDs. While this is smaller than the usually

    capacity of each of the media types it is recommended that you use these defaults.

  • 8/6/2019 Disk Backup

    23/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 23

    4. Altering the FTP information (If you are using ftp to store your backup files)Now referring to the table at the beginning of this document you need to edit the following fields

    with your information IF YOU ARE USING THE FTP TRANSFER FEATURE! The ftp transfer is by default

    TURNED ON. Please supply the USERNAME, PASSWORD, REMOTEDIRECTORY, and SERVER. The

    DIRECTORY information SHOULD NOT BE CHANGED! Once you have entered the information Hold

    down the CONTROL key and tap K then X (if you are using joe) to save the file. Now you need to

    reopen the file to continue editing. Press the UP arrow on your keyboard once and Linux will supply

    your last command. Now tap the ENTER key and you will be back into the disk-backup.conf file.

  • 8/6/2019 Disk Backup

    24/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 24

    5. USB InformationFrom within the editor scroll down the page until you see the following:

    You will need to enable using USB hard/flash drives by changing CPFLASH=1. We recommend you

    leave USBFS and USBMOUNTPOINT set to the defaults. You may need to change the

    USBDEVICENAME to what your local USB Hard/Flash drive is referred by the operating system. The

    steps required to ascertain this are outline in appendix one of this guide.

  • 8/6/2019 Disk Backup

    25/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 25

    6. SMB InformationFrom within the editor scroll down the page until you see the following:

    You will need to enable using network attached SMB drives by changing CPSMB=1. You will need

    to change SMBMACHINE, SMBSHARE, SMBUSER, SMBPASS. DO NOT CHANGE THE LOCALMOUNT!

    NOTE SMBMACHINE MUST BE A IPADDRESS ONLY! Using a machine name will not work!

  • 8/6/2019 Disk Backup

    26/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 26

    7. Pogo Plug informationOne new feature of this program is the ability to backup to an internet attached storage device

    referred to as a Pogo Plug. Currently the PIAF Lab backs all of it test machines to a Pogo Plug device

    which has a total of 8 TB of storage. The Pogo Plug is stored offsite to help assure business

    continuity in case of a disaster. The initial development of using this device with PIAF is all thanks to

    Ward NerdUno.

    You will need to enable using network attached Pogo drives by changing CPPOGO=1. Do not

    change the PMOUNT variable. Your PNAME should be your email address you use to log in to your

    Pogo Plug. PPAS is your password for the Pogo Plug. POGOROOT is the name your Pogo Plug assigns

    to the hard drives connected to the PP. This is usually the hardware name which can contain spaces.

    We recommend you rename the Hard drive to something that does not have spaces in the name.

    This can be accomplished by using the web interface to your Pogo Plug. Lastly the POGOPATH is the

    name of the backup folder you wish to use under the POGOROOT. It can be anything but we

    recommend you do not use spaces in the name. If this directory does not exist it will be created onthe Pogo Plug the first time the disk-backup.cron is ran.

  • 8/6/2019 Disk Backup

    27/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 27

    8. Log compression facilityThis feature allows the log file to be compressed with gzip and sent as a file attachment in an email.

    Normally the log file is piped to the body of the email but due to the size some email servers will

    reject the message.

    Set GZIPPEE to equal 1 to enable this feature.

    Testing the disk-backup.cron file

    A critical step is to test the disk-backup.cron file. This test will take a very long time. I recommend you

    start it and go to lunch. In the CLI type cd /etc/cron.weekly and then tap the ENTER key. Now type

    ./disk-backup.cron and then tap the ENTER key. Now go away for a while. If everything was configured

    properly the command should complete with no error messages on the screen. However your mileage

    may vary. One or two error messages seems to be ok during normal operation. I recommend you look at

    the log file /var/log/disk-backup.cron.log. Check on your ftp/usb/smb/Pogo sites to see if the files were

    copied over. Generally there should be an emergencyboot.iso and a Mondorescue-1.iso file. Depending

    on the size of files backed up there may be others in the Mondorescue series These are your actual

    backups and may span multiple ISO files.

  • 8/6/2019 Disk Backup

    28/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 28

    Restoring your PBX in a Flash 1.7.5.5

    When I was writing the backup program I opted to use a CDROM sized ISO. This was done as I wanted to

    the most common denominator that would run on the most systems. You are free to modify the size of

    the Mondorescue produced ISO files as it does support DVD size with no problems. I would recommend

    you read the Mondorescue documentation prior to altering the configuration file!

    Scenario

    You are running you backups weekly on a Sunday and your PBX in a Flash 1.7.5.5 dies on a Wednesday.

    Solution

    You have been storing the backup files on a remote ftp site. Log onto the ftp site and download the ISO

    files to a windows machine. You notice there are a total of three ISOs. One is called emergencyboot.iso

    and the others are labeled mondorescue-1.iso and mondorescue-2.iso. Burn all three disks to cdroms

    and label them EmergencyBoot, Restore- 1, and Restore- 2.

    Repair the hardware on your ailing PBX in a Flash 1.7.5.5 system. You just happen to have another

    machine available with the exact same hardware (Mondorescue does support restoring to different

    hardware geometry but that is beyond the scope of this document. )

    Place the Restore-1 disc into the CD drive and boot the system. If the boot fails try using the Emergency

    Boot disc. Eventually you will get to an instructional page. Type nuke and then tap the ENTER key.

    Mondo will go through some checks and just follow the onscreen prompts until the restore is complete.

    Reboot the system. You should be back at where you where when the last hard drive/partition backup

    was performed.

  • 8/6/2019 Disk Backup

    29/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 29

    Appendix One Configuring and installing your USB drive

    You should repartition and reformat your USB drive using Linuxs fdisk and mkfs prior to using it with

    PBX in a Flash 1.7.5.5. We now recommend that you reformat your USB flash drive to ext3 format

    which seems to be more reliable under Linux.

    Setting up your USB Flash Drive

    Adding a flash drive can be easily within PBX in a Flash 1.7.5.5 Insert your flash drive into a USB port and

    wait a few minutes. Then log in to the Command Line Interface on your PBX in a Flash using putty or a

    similar program and do the following.

    STEP 1 Where is my drive?

    Type dmesg in the CLI and tap the Enter key. You may have to look thru the output until you find

    something similar to below.

    Notice that Centos calls USB flash drives SCSI. What you are looking for is the SCSI address that the OS

    assigned to it. The 9th line from the top tells us that it is device sdd. This translates to the path /dev/sdd.

    Please write this address down in the USB Table at the beginning of this document. Notice on the thirdto last line the snippet sdd: sdd1. This means that the usable partition is actually sdd1. Other names can

    be sdb, sdc, etc

  • 8/6/2019 Disk Backup

    30/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 30

    STEP 2 Partitioning and Formatting the USB Drive

    In order to use the drive you need to repartition and format it. This will delete ALL existing

    information on the drive!

    At the CLI type: fdisk /dev/sdd (substitute your dive letter for sdd)

    Then tap the enter key and then tap the m key and then the Enter key. You should see a display similar

    to below.

  • 8/6/2019 Disk Backup

    31/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 31

    Now we need to delete the existing partition. Tap the d key, and then tap the Enter key. This will

    delete the partition.

    Now create a new partition on the flash drive. Tap the n key and then the Enter key. It will now ask

    you for the Command Action tap the p key and then tap the Enter key. It is now asking for a Partition

    Number. Tap the 1 key and then tap the Enter key. Tap the Enter key twice more.

    Ensure the partition type code is 83! Tap the t key and then enter 83 . You should see a screen similar to

    the one below and it will indicate the drive is linux.

    Now write the changes to the disk. Tap the w key and then tap the Enter key. Eventually you will see

    the screen below.

  • 8/6/2019 Disk Backup

    32/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 32

    Congratulations you have successfully repartitioned you USB disk.

    Now we need to format the drive using the ext3 file system. At the CLI type the following

    Mkfs t ext3 /dev/sdd1 (substitute your drive letter)

    Now tap the ENTER key. You should see something similar to the screen below

    You have successfully formatted you USB flash drive to use the ext3 file system.

  • 8/6/2019 Disk Backup

    33/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 33

    STEP 3 How to use the drive?

    The manual way to mount and unmount your usb drive is command line based. In order to mount the

    drive type the following mount -t ext3 /dev/sdd1 /mnt/usbmondo and then tap the ENTER key.

    Type cd /mnt/usbmondo and then tap the ENTER key. Type the command ls and then tap the ENTER

    key. You have successfully mounted your USB flash drive.

    In order to unmount the drive type cd /root and then tap the ENTER key, Now type

    umount /mnt/usbmondo

    And then tap the ENTER key. The USB drive is disconnected from the mount point and no longer

    accessible.

    For the disk-backup.cron program to work you need to ensure you unmount the USB flash drive. This

    helps ensure that your backup files cannot be accidentally modified.

  • 8/6/2019 Disk Backup

    34/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 34

    Appendix 2 Information

    There are several different files that are created when disk-backup.cron runs. The log files are located in

    the /var/log.

    disk-backup.log this is the log created by disk-backup.cron. This log is also mailed toroot@localhost or other specified email account after each run.

    Install-diskbackup.log This contains information about what was installed and when

    ISO files created

    Emergencyboot.iso This file is strictly a boot disk and is OPTIONAL. It is made available in caseyou have difficulty booting from the mondorescue-1.iso disk. You do not need to burn this diskroutinely.

    Mondorescue-1.iso this is the first disk in the backup series and contains a bootable partition.Simply place the disk into the system to be restored and let it boot. If you have difficulties then

    you can use the emergencyboot.iso listed above. You may only have mondorescue-1.iso if your

    PIAF system is small. If the backup exceeds the capacity of a single media then more isos will be

    created. These will be numbered mondorescue-N.iso with N = the volume number.

  • 8/6/2019 Disk Backup

    35/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 35

    Appendix 3 Running Mondo Manually

    Step 1

    o Log into your PBX in a Flash 1.7.5.5 CLI as user rooto Type amportal stopo Type mondoarchive and then tap the ENTER key. You should see a screen similar to below.

    If you see this screen then Mondoarchive and all of its associated programs were installed correctly.

    Now you simply choose the media that you wish to backup to. For this demo I am using DVDs. Tap the

    ENTER key to continue.

  • 8/6/2019 Disk Backup

    36/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 36

    Step 2

    You need to choose how much compression you wish to use. The more the compression the smaller the

    files and this means less backup disks. The down side is the higher the compression the longer it takes to

    complete the backup job. I recommend you try average to begin with! Tap the ENTER key to continue.

    Step 3

    Now you have to choose the size. I recommend you use what Mondoarchive suggests. Tap the ENTER

    key to continue.

  • 8/6/2019 Disk Backup

    37/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 37

    Step 4

    Mondoarchive will now ask you to specify your DVD drives path. Generally it is safe to simply tap enter

    if there is something displayed in the blue area as you can see below. If there is nothing specified in this

    box Centos does not recognize your CD/DVD drive. This problem is beyond the scope of this document

    to fix and it is recommended you look on the internet for help. We am unable to assist you with this

    type of problem.

  • 8/6/2019 Disk Backup

    38/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 38

    Step 5

    Mondoarchive now asks what you want to backup. Leave this as default. Tap the ENTER key to continue.

    Step 6

    Mondoarchive asks you what you want to NOT backup. You can leave it blank. Tap the ENTER key to

    continue.

    If you are storing files on a local directory then you may include it.

  • 8/6/2019 Disk Backup

    39/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 39

    Step 7

    If this is a mission critical backup I would suggest you choose yes to the next screen. If you have multiple

    disks you may be asked to insert them back in one after another. Tap the ENTER key to continue.

    Step 8

    Are you confident your kernel is sane? What a question! In fact mindi does not consider the kernel sane

    as the grub.conf uses the LABEL= statement. However it is safe to choose yes here. Note if you choose

    No the backup will fail as a mindi image is not installed. Tap the ENTER key to continue

  • 8/6/2019 Disk Backup

    40/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 40

    Step 9

    Last chance to abort the installation! Please ensure you have inserted a blank CDROM/DVD into the

    burner. (The media size depends on your earlier choice) Tap the ENTER key to continue.

    Step 10

    Backup progresses and you will see several screens below. That is about it; mondo will prompt you for

    extra disks if it needs them. I recommend you label each disk as it comes out of the burner with its

    number and date.

  • 8/6/2019 Disk Backup

    41/42

    Whole Disk Backup March 2011

    Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 41

  • 8/6/2019 Disk Backup

    42/42

    Whole Disk Backup March 2011

    Note the image above was taken from a vmware machine that for some reason did not support the built

    in DVD burner!

    Restoring

    In order to restore things simply insert the first DVD into your machine and boot it. You will see

    mountains of warnings etc. Please ignore them as they are really meaningless. Eventually you will get to

    the restore screen and you simply type nuke and then tap the ENTER key.