Mondo Rescue
with RAID in Debian
What is Mondo Rescue?
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, 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) and
is getting better all the time. You may even use it to backup
non-Linux partitions, such as NTFS.
Download Mondo Rescue
http://www.mondorescue.org/downloads.shtml
Mondo Rescue
Documentation
http://www.mondorescue.org/docs.shtml
The problem is that the Debian Sarge package
for Mondo does not work well with RAID (it actually does not
work at all). This is because Sarge no longer supports
raidtools2 but rather mdadm only. Mdadm is better, so if you
have not picked it up yet you really should. Until it's patched,
here is an easy work around, while not elegant, it should allow
you to restore your data on RAID systems.
Requirement
The first step is to have a Debian Sarge system running RAID.
This can be done via the installer or later by hand whichever
you prefer. Now that the installer allows you to create a RAID
during the initial install, I imagine more people now run RAID
on Debain than before.
Install Mondo Rescue in Debian
#apt-get install mondo
Now we need to edit some configuration files to add a few
packages to mindi (part of mondo). Because the default install
uses raidtools and Sarge does not have raidtools, we have to
tell Mondo to add the package mdadm. Use whatever editor you
like and modify
/etc/mindi/deplist.txt
Add the following to pretty much anywhere, I put in under the
"Covers a multitude of sins" section
mdadm cfdisk
cfdisk is optional but I like using that much more than fdisk.
Create the Image
There are many ways to make a mondo image. You can burn it
directly to a CD/DVD but I prefer to create an iso image on the
host drive and then transfer and burn it somewhere else.
#mondoarchive -Oi -d /var/images/ -S /var/images/ -E /var/images/
-s 4200m
This command creates an archive image in the /var/images/
directory. It also excludes the /var/images directory in the iso
it's creating (you dont want an image of your image). The "-s"
section is for size, since I am making a DVD it's at 4200 megs,
but if it was a cd you leave that switch out. Make sure that the
directory is already created and you can pretty much use any
location you want as long as it has enough room. After it's done
(it could be awhile) you will have a compressed image of you
disk, usually called something like 1.iso under the images
directory. Burn that disk image to a cd/dvd and you now have a
bootable drive you can recover your system from.
Recovery
Put the CD in machine you want to put the image on and boot
(make sure boot to cd is enabled in your bios). When the Mondo
boot screen appears, type
expert
and hit return. This will get you to a basic shell where you can
create your new RAID devices to put the image on.
One in the shell use tools like cfdisk and mdadm to recreate
your RAID devices. I assume you have done this before but for
record here is the basic instructions for a RAID 1(mirror)
setup.
Create partitions of equal size on 2 hardrives.
If booting directly to the raidset without an initrd image (and
you recompiled your kernel to allow this) make their type fd
Create the RAID set. (assuming your using drive hda and hdc and
its partition one on those drives) - Do the below for each raid
device.
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[ac]1
Check /proc/mdstat and wait until they are synced
Create the file system you want, example mkfs -t ext3 /dev/md0
or mkswap /dev/md1
Now run
mondorestore-> Interactive -> Ok to mount list -> No to erase
and partition -> Say no to format -> Yes to Restore all data
Grub After looking at what I wrote I realized I forgot about
grub. It also seems that grub does not always work through mondo
when doing it this way. To fix it you just install grub by hand.
After the restore has happened it should bounce you out to the
shell. This assumes you have 2 drives hda and hdc, with the
first partition as the bootable partition.
grub
device (hd0) /dev/hda
root (hd0,0)
setup (hd0)
Now we do the same thing but for the other drive, assuming that
your boot partition is mirrored.
grub
device (hd1) /dev/hdc
root (hd1,0)
setup (hd1)
Once finished you should have an exact clone of your machine
running on RAID devices. You can also restore to non-RAID or
visa versa but it's a little bit more tricky. If your interested
in that, let me know and I will add it. I hope this helps
someone that has also run into the problem with RAID, Mondo and
Debian Sarge.