Zenwalk Linux

Ever tried Zen computing?

Backup your system with mondorescue

 

From Zenwalk Wiki

(Redirected from Mondo)
Jump to: navigation, search


This article is part of the Zenwalk HOWTO.
Installing/Setting Up | Internationalisation | Networks | Software | Package Management | Misc

[edit] Intro

Mondorescue (http://www.mondorescue.org)is a powerful tool to create images of a live system. It can generate an iso file (cd, dvd), write the result of the backup to a tape or even create a bootable usb device.

  • Note : test & screenshots in this article have been realised thanks to VirtualBox

[edit] Installing Mondo

Just netpkg the following packages : mondo, mindi, afio, buffer, newt

(a 'netpkg mondo' should even be sufficient because of the dependencies)

[edit] Backup your system

The example taken here will create a simple cd sized iso file of a fresh Zenwalk Core 5.0 install.

Before starting mondo, I recommend you create 2 dirs :

  • the destination dir : where the iso will be created
  • a 'scratch & temp' dir : used by mondo to temporarily create all the needed files.

Mondo will not start if these dirs don't exist. In my example, I use respectively '/root/blah' & '/tmp/blah' for these dirs.

A brief explanation of the flags used with mondo :

  • -O : create a backup
  • -V : verify backup
  • -i : create an iso file
  • -d : destination directory
  • -s : size of the image (ex: 700m for 700 MB, 4g for 4 GB)
  • -E : directories to exclude for the backup
  • -S : scratch dir (internally used by mondo)
  • -T : temp dir (internally used by mondo)
  • -9 : (gzip) compression level (from 1 to 9)

Of course, you should take care of the available space you have on your disks ... That's why it could be a good idea to think about what has *really* to be saved, and to make some "disk cleaning" before proceeding.

So here we go with a command line like :

mondoarchive -OVi -d /root/blah -s 700m -E '/tmp/blah /root/blah /sys /dev /proc' -T /tmp/blah -S /tmp/bah -9 :

Image:mondo1.jpg

Mondo then starts to 'analyze' your system : Image:mondo2.jpg

In fact, Mondo will create lists of all the files on your system : Image:mondo3.jpg

Once the lists are created, Mondo will call its little sister Mindi to create the boot disks for the resulting image : Image:mondo4.jpg

This step could take a while (and it's not verbose ...), but once finished, Mondo will take the lead again to actually backup your files: Image:mondo5.jpg

As indicated, the backup could take a couple of hours, depending on the amount of data to backup & the speed of your system ...

In the next step, Mondo creates the iso image out of the collected data : Image:mondo8.jpg

Once the iso has been created, it's time to verify the backup : Image:mondo9.jpg

And then you're done :
Image:mondo10.jpg

Your iso image is located in the directory you specified on the command line (here /root/blah), and it's named mondorescue-1.iso. Of course, if the amount of data is too large to fit on a single iso, multiple files are created as mondorescue-1.iso, mondorescue-2.iso, etc. It's up to you to decide what you want to do with your iso files. You can for example burn it directly if you can do it on the machine, or you can copy the files on a different box to keep it in case of a problem.
What I usually do is "cross copy" the resulting files from 2 machines via scp, in order to always have a backup of 1 machine on the other.

[edit] Restore your system

One great thing about mondo is that the iso image we have just created is in fact a "self installable" version of our system. So if we want to restore the backup on the original machine (same hardware), we just have to boot on the cd which can be burnt out of the iso image, and choose an automatic install. It is also possible to restore the system interactively, to change some of the parameters, say the scsi controller (if you use one), the size of the partitions, ...

As an example, we will show the case of an automatic restore.

Let's first boot on our backup CD :
Image:mondo12.jpg

After pressing enter, the system boots the kernel (note that Mondo uses the same kernel as the one on the original system). There are usually a lot of errors displayed in this stage cause Mondo tries a lot of things to be sure the system is 'ready' to be restored, such as trying to load some modules multiple times (even if that fails ...).
Image:mondo13.jpg

And then it's time to choose the type of restore we want :
Image:mondo15.jpg

After choosing 'automatic' restore, we specify the type of media we used for backup (say CD-R) :
Image:mondo16.jpg

And then we just have to watch as Mondo restores all the stuff, step by step :

A safe warning :
Image:mondo17.jpg

Creation of the partitions :
Image:mondo18.jpg

Formatting :
Image:mondo19.jpg

Actual restoring :
Image:mondo22.jpg

Success !
Image:mondo25.jpg

Back to a shell, we just have to reboot to find our system back.
Image:mondo26.jpg


[edit] Zenwalk limitations

Mondo has been tested successfully on different systems, including :

  • simple PCs with IDE controller
  • servers with scsi/raid controllers (IBM, HP, Compaq, Dell, NEC)
  • VMWare images
  • VirtualBox images.

Some interactive install have also been realised, allowing me to install fully functional systems from iso images created on VMWare (ex : from IDE based VMWare iso to scsi based real server).

Be careful though to (at least) two limitations I found regarding the use of Mondo with Zenwalk :
1. If you restore an image on a system with a different network interface card (whose MAC address should then be different than the original one), the network won't certainly be functional after reboot. It's due to the use of a udev rule which forces the names of the interfaces based on their MAC address (see /etc/udev/rules.d/60-interfaces.rule). The solution can be as simple as editing this file to rename the interface with the correct name (ex : eth0 may have been renamed as eth1, in this case, just put the correct name back in the file), and rebooting.
2. Restoring and "IDE based" created iso image on an scsi based box does not work out of the box due to the fact that Zenwalk uses 2 different kernels, an "ATA" one and a "SCSI" one. Indeed, as mentionned above, Mondo (in fact, Mindi) uses the same kernel the machine uses, so this one would not be able to "see" SCSI disks. In this case, a 'man mondoarchive' or 'man mindi' could be of help ... and thanks for your feedback then :)

[edit] Problems

I rarely saw problems with mondorescue, but ... in case you have trouble using mondo, you should first have a look at the log files (/var/log/mondoarchive.log, /var/log/mindi.log), which are most of the time verbose enough to track down problems.

Beyond that, a visit at Mondorescue's forums (http://www.mondorescue.org/support.shtml) could be useful as well as a look at the documentation & the man pages of these great tools.

[edit] How-to Articles

Helpful articles about Mac OS on Mac-How.net

Personal tools