Welcome to the Mondo Rescue API manual!
Mondo Rescue is a backup/disaster recovery program and library intended to allow backups to be restored completely and simply even if the hard drive has been wiped. No data loss has been reported since mid-2000.
If you are not a Mondo developer, don't want to become one, don't want to write an add-on, and don't want to know about Mondo's internals for some other reason, this page is not for you. This is not a user manual; it is a developer's manual. This is our internal documentation. It's intended to be complete, not easily comprehensible by non-programmers. You have been warned.
Currently all functions except those involved in prepping hard drives and restoring data have been placed into a shared library which can be used in add-ons to Mondo (for example, a new interface or network transparency). Generally you'll want to call backup_data() or verify_data() to do the work for you, but if you want to do the steps yourself, that's OK too. See the modules called "Mid-Level Backup Functions" and "Low-Level Backup Functions" for details.
If you want to write a facelift for mondorestore, please note that the restore/prep functions are not in the shared library. If you wish to use those, please either:-
There are two versions of the libmondo library. One is a generic version (you must link in Newt to use it, though it doesn't actually use newt) which requires a separate GUI library; the other is an X library rather tightly coupled to XMondo. See the source code in mondo/xmondo/*.cpp for more details. Currently only a Newt add-on GUI library is available for the "generic" library; if you want another please copy newt-specific.c and change the function bodies. (If you think your work might be useful to us, please email the list). To link with the generic Mondo library, add these flags to your link command:
To use the X library, compile with the flags as above but replace
-lXmondo. And read the XMondo source code first! Your problem may have already been solved.
Mondo currently runs on i386 Linux and FreeBSD using a rather ugly mess of #ifdefs. Ports to other OSs may come someday, probably only if someone writes them.
Mondo uses Mindi to create the boot disks. Mindi is rather system dependent; currently there are separate versions for each port (two), but eventually the two may be combined. The current version of Mindi is a shell script, but the next generation (goes live Nov. 1) is in Perl (and runs about 4 times faster). If you are experiencing bugs related to the mountlist, or anything that happens before you get the mondorestore Newt screen, you should look at Mindi; Mondo does not control the boot process.
The s_bkpinfo structure (commonly referred to as "the bkpinfo") is the heart of Mondo. If you're new to the code, you really should read its documentation first. Trust us, that will help your understanding of the rest of it immensely. The functions in libmondo-archive.c are the most important; tackle those first. If you're writing an add-on, you may be able to get away with just those and the ones in newt-specific.c.
Thank you for using Mondo Rescue, and good luck in your development!
Here is a list of terms used throughout the documetation and what they mean.
afioarchive for a particular fileset. Sometimes "tarball" is used, even though the archives were not made by
afioprovides many benefits, including the ability to compress files individually so a bad block doesn't ruin the whole archive.
bkpinfo->optimal_set_size-sized chunks and compressed. The file's stat() information (name, modification date, mode, owner, group, etc.), as well as its checksum, is stored in the "zeroth" slice. This allows us to split large files over multiple CDs, without resorting to things like the "cutstream" method practiced by mkCDrec.