You are on page 1of 42

PBX IN A FLASH DEVELOPMENT CORPORATION

PIAF Dev Corp


Digitally signed by PIAF Dev Corp DN: cn=PIAF Dev Corp, o=PBX in a Flash Development Corporation, ou=Executive, email=support@piafdevcorp.com, c=US Date: 2011.03.25 11:21:00 -04'00'

Backing up your PBX in a Flash 1.7.5.5 installation


PIAF Development Corporation March 25, 2011

Whole Disk Backup

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

Whole Disk Backup

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 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.

March 2011

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

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.

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

Page 2

Whole Disk Backup OVERVIEW

March 2011

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. 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, CDRW, 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 the mailing list with 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.

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

Page 3

Whole Disk Backup METHODOLOGY

March 2011

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. 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. REQUIREMENTS There are several requirements to run the disk backup script and they are outlined below. It is recommended you have met all of the requirements prior to performing the installation and configuration. o A working PBX in a Flash 1.7.5.5 installation. Note this software is designed to work with PBX in a Flash 1.7.5.5 ONLY A command line editor you are comfortable with on your PBX in a Flash. We use joe as our command line editor. Various pieces of information that you will require in order to make the file transfer methods you have selected work. Below is a table of all of the required information. Simply fill the information for the method of storage you have selected. By default ftp is enabled and USB/SMB is disabled.

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

Page 4

Whole Disk Backup A least one of the following o o An ftp account on a remote system that you can log into and upload files

March 2011

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. Access to a shared drive on a Windows/Samba server with sufficient privileges to read and write files Access to a Pogo Plug share

Information Tables to be filled out prior to Installation


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. Program Options VARIABLE NAME Default Value User provided value Description 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

CONFIGURED

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

Page 5

Whole Disk Backup Configuration Options VARIABLE NAME Default Value User provided value Description

March 2011

This switch tells the program to remove the log files from the previous weeks run REMLOGS 1 0 = Do not remove previous log files 1= Do remove previous log files This switch instructs the program to email the log file to a email address specified in /etc/pbx/emailscript.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 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.

SENDLOG

DELBACKUPS

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

Page 6

Whole Disk Backup Mondorescue Configuration VARIABLE NAME Default Value User provided value Description

March 2011

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 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!

MFILESIZE

4300m

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

Page 7

Whole Disk Backup Ftp Information VARIABLE NAME Default Value User provided value Description

March 2011

Once the ISOs have been created by Mondorescue copy them to an ftp store CPFTP 0 0 = Do not copy to ftp share 1 = Copy to ftp share USERNAME PASSWORD REMOTEDIRECTORY SERVER ftpuser ftppassword / ftp.server.ip This is the username that you use to log onto the remote ftp server This is the password used to log onto the remote ftp server This is the remote ftp directory you wish the backup files to be placed minimum is / This is the IP address or Fully Qualified Domain Name of the ftp server

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

Page 8

Whole Disk Backup Usb drive info VARIABLE NAME Default Value User provided value Description

March 2011

CPFLASH

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 It is recommended you DO NOT change this Where the flashdrive is mounted to default is /mnt/usbmondo 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

USBMOUNTPOINT=

/mnt/usbmondo

USBDEVICENAME=

/dev/sda1

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

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

Page 9

Whole Disk Backup Smb Share Information VARIABLE NAME Default Value User provided value Description

March 2011

CPSMB

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 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 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 It is recommended you DO NOT CHANGE THIS! This is the local folder that the remote SMB share is mounted to. NOTE dont change thus unless you understand how. This is your username on the remote Windows/Samba machine This is your password on the remote Windows/Samba machine.

SMBMACHINE=

192.168.1.5

SMBSHARE=

sharename

LOCALMOUNT=

/mnt/smbmondo

SMBUSER= SMBPASS=

user pass

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

Page 10

Whole Disk Backup VARIABLE NAME

Pogo Plug Information Default Value User provided value

March 2011 Description 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

CPPOGO

PMOUNT

"/mnt/pogoplug"

This is the local mount for Pogo Plug It is recommended you do NOT change this This is the username to log into a Pogo Plug. Note it should be in the form of an email address This is password used in conjunction with username to log into a Pogo Plug 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 This is the destination directory on the Pogo Plug. If it does not exist it will 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 Page 11

PNAME

"test1234@nowhere.com"

PPASS

"password"

POGOROOT

"16gbflash"

POGOPATH

"test 15"

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

Whole Disk Backup Rsync information VARIABLE NAME Default Value User provided value Description

March 2011

USYNC

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 Value User provided value Description With this option gzip will compress the log 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)

GZIPPEE

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

Page 12

Whole Disk Backup Email configuration

March 2011

The configuration of sending automated emails for log files was moved to a separate configuration file. Many of PIAF support programs now use this file in order to ascertain if log files are to be sent and to whom the email goes to. This file now resides in /etc/pbx and is called script-email.conf VARIABLE NAME Default Value User provided value Description Place your own email address here, enclosed in double quotes. If you leave it the default it will send the log files to the root account. With this setting you can tell the application to always send a copy of the logs to the addressee. 0 = Do not email the logs 1= Send the application logs via email. NOTE This feature will only work if you have your sendmail/postfix configured to send email outside of your PBX in a Flash system. Please dont ask for help on configuring your sendmail/postfix. You must test your sendmail/postfix install by sending a test message outside of your PBX in a Flash system.

EMAIL=

root@localhost

USEEMAIL

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

Page 13

Whole Disk Backup PROCEDURE

March 2011

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. 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 remote machines 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 a USB 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 Software 4. 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!

INSTALLING THE SOFTWARE Please log onto your PBX in a Flash 1.7.5.5 system as root and perform the following steps 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

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

Page 14

Whole Disk Backup

March 2011

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

Page 15

Whole Disk Backup STEP 2

March 2011

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

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

Page 16

Whole Disk Backup

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

March 2011

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

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

Page 17

Whole Disk Backup Then

March 2011

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:

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

Page 18

Whole Disk Backup

March 2011

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

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

Page 19

Whole Disk Backup

The screen will look similar to the following:

March 2011

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

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

Page 20

Whole Disk Backup

Configuring the disk-backup.conf file

March 2011

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. 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

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

Page 21

Whole Disk Backup

March 2011

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.

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

Page 22

Whole Disk Backup

4. Altering the FTP information (If you are using ftp to store your backup files)

March 2011

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.

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

Page 23

Whole Disk Backup

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

March 2011

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.

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

Page 24

Whole Disk Backup

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

March 2011

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!

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

Page 25

Whole Disk Backup

7. Pogo Plug information

March 2011

One 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 on the Pogo Plug the first time the disk-backup.cron is ran.

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

Page 26

Whole Disk Backup

8. Log compression facility

March 2011

This 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.

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

Page 27

Whole Disk Backup

Restoring your PBX in a Flash 1.7.5.5

March 2011

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.

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

Page 28

Whole Disk Backup

Appendix One Configuring and installing your USB drive

March 2011

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 third to last line the snippet sdd: sdd1. This means that the usable partition is actually sdd1. Other names can be sdb, sdc, etc

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

Page 29

Whole Disk Backup

STEP 2 Partitioning and Formatting the USB Drive

March 2011

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.

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

Page 30

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

Whole Disk Backup

March 2011

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.

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

Page 31

Whole Disk Backup

March 2011

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.

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

Page 32

Whole Disk Backup

STEP 3 How to use the drive?

March 2011

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.

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

Page 33

Whole Disk Backup

Appendix 2 Information

March 2011

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 to root@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 case you have difficulty booting from the mondorescue-1.iso disk. You do not need to burn this disk routinely. 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.

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

Page 34

Whole Disk Backup Step 1 o o o

Appendix 3 Running Mondo Manually

March 2011

Log into your PBX in a Flash 1.7.5.5 CLI as user root Type amportal stop 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.

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

Page 35

Whole Disk Backup Step 2

March 2011

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.

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

Page 36

Whole Disk Backup Step 4

March 2011

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.

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

Page 37

Whole Disk Backup Step 5

March 2011

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. Copyright 2007 2011 PBX in a Flash Development Corporation All Rights Reserved Page 38

Whole Disk Backup Step 7

March 2011

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

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

Page 39

Whole Disk Backup Step 9

March 2011

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.

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

Page 40

Whole Disk Backup

March 2011

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

Page 41

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.

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

Page 42

You might also like