Thursday, April 20, 2006
Bare Metal Backup and Restore (Mondo Part 2)
Yesterday Bare Metal Backup and Restore (Part 1) covered installation of Mondo Rescue, an open source backup program for use on Linux systems. It can be found at http://www.mondorescue.org/ and their documentation can be found at http://www.mondorescue.org/docs.shtml
Today we cover, making a backup with Mondo Rescue...
Just for completeness, you MAY have to add a parameter to your boot loader for the CD to be recognized. Look at your dmesg output and find your CD-R[W] and find the /dev/hda/b/c/d designation. Depending on your boot loader you will need to add the parameter according to your boot loader instructions. I use hdc=ide-cd. Some may use hdc=ide-scsi etc.
Making a backup
To begin your interactive backup, you can simply type mondoarchive and go through the menus. There is a nice step by step walk through in the documentation here http://www.mondorescue.org/docs/mondorescue-howto.html#QUICKSTART. If you want to make the backup unattended you can use many switch options that are available with mondoarchive.
If you want mondoarchive to back up your filesystem to CD, tape, ISO images or a network share you must use the -O switch. Boot floppies or a special boot CD will be created to allow you to restore from bare metal if necessary. It is a good idea to use the -N directive when backing up to an NFS share. Also the -E directive could be used to exclude network shares and another good practice is to always exclude the directory you are sending the ISO images to.
It is always a good idea to verify your backups. Backups are worthless without the ability to restore from them. A complete waste of space and time if the backups are corrupt. Monoarchive's -V verifies the backup against the live filesystem. This option may be used in combination with -O to verify a backup after its creation, or on its own to see how much the live filesystem has changed since the backup was made.
My approach is straightforward. Put all the usual switches first, then follow up with any unusual ones. I don't backup any network mounted disks. I use the best compression available. My local backup disk is /backup_area. I call my backup images by the machine _name.the_date. I write 700m iso files so that I can burn them later to 700m CD-RWs. I don't make bootable floppies. I will make archive disks on CD-Rs or DVD-Rs once a month.
My core command is:
mondoarchive -OV -N -d /backup_area -E "/backup_area" -9 -F -p `hostname`.`date +'%m%d%Y'` -s 700m
If I want to backup to a local disk, I use:
mondoarchive -OV -N -d /backup_area -E "/backup_area" -9 -F -p `hostname`.`date +'%m%d%Y'` -s 700m -i
If I want to backup to an NFS share, I use:
mondoarchive -OV -N -d /backup_area -E "/backup_area" -9 -F -p `hostname`.`date +'%m%d%Y'` -s 700m -n Backup_Server:/backup_area
For other forms of media, use the -c for CD-R, -w for CD-RW, the -r for DVD, the -t for Tape. When using the -c or -w it is necessary to state which device is going to be used by using the -d option. The -d option will take the SCSI numbering scheme which can be gotten by using cdrecord -scanbus The SCSI ID usually looks like 1,0,0 or similar.
mondoarchive -OV -c 8 -d 1,0,0 -F -E "/backup_area" -9
Burn to Media
The command will be something like the following for CD-RWs:
cdrecord -blank fast dev=1,0,0 speed=2 `hostname`.`date +'%m%d%Y'`-#.iso
cdrecord -blank fast dev=1,0,0 speed=2 zero.domain.04212006-1.iso
The command will be something like the following for CD-Rs:
cdrecord dev=1,0,0 speed=8 zero.domain.04212006-1.iso
I actually used the command
cdrecord speed=8 zero.domain.04212006-1.iso
After you have created each of your recovery CDRoms remember to label them. I usually use a black Ultra Fine Point Permanent Marker and include the name of the iso & the disk number of how many. e.g. zero.04212006 Disk 1 of 5.
A full explanation of all the mondoarchive switches can be seen in the man page.
Here is a link to the man page http://www.mondorescue.org/docs/mondoarchive.8.html
The Install Process
Bare Metal Backup and Restore (Part 1)
The Backup Process
Bare Metal Backup and Restore (Part 2) - This article
The Restore Process