Mondo CLI

If you want to do a backup in Linux, there are many tools for the job. But if you want the ability to recover from a disaster, as well as back up, only a handful are left. Of those, less than half are able to replace the functionality of Ghost or Acronis TrueImage in a Linux environment, and of those, only one or two (that I know of) can do this without either being ridiculously confusing or requiring a network or backup server.

The winner for me (and my mission critical business computers) is Mondo Archive. With Mondo Archive, you can do all sorts of nifty things, such as back up your windows/linux dual boot and automatically restore them to a completely different computer, restoring to a different disk setup or file system, and more. Here is a simple guide to using it.

Step 1: Install Mondo from Synaptic by first starting Synaptic, entering your root password, and then doing a search for the word "mondo" (without the quotes). Select it for installation. Several dependencies will be added.

Step 2: After you have installed them all, determine whether you will be using hard disk, CD, DVD or something else to back up to. Mondo supports CD-Rs, CD-RWs, DVDs, creating .ISO images on your hard disk, tape drives, CD Streamers and NFS mounts for backing up to. If you have the disk space to spare, and you plan to make CDs or DVDs, I suggest creating .ISO files on your hard disk and then later burning them to whatever media you have chosen later, although Mondo can do direct to device burning, too. I do it this way to make sure the run ends successfully before I overwrite my DVD-RW backup set. The alternative is to have multiple backup sets if you use RW media. Right now, that's not feasible for me. If you do store your images on the hard drive, you will want to have a specific directory set up to hold them. I use /home/myhomedir/backup. You would replace myhomedir with your login name, of course.

Step 3a: Decide how you want to run Mondo. I used to run it in its GUI mode. Note that this is a CLI based GUI. You can do this by invoking the program from a terminal you are logged into as root, like so:


[root@localhost backup]# mondoarchive

Mondo will then automatically detect as much information as possible, and will walk you through the rest. When it asks you whether your kernel is sane, for PCLinuxOS, the answer is YES. (Of course it is!)

Step 3b: If you need greater control than you can get from the GUI, as I do, you will need to use the CLI and type in a rather long command. Here is the command I use to create full system backups, which I will dissect for you afterwards:


mondoarchive -O -V -i -s 4480m -d /home/shannon/backup -I / -E /home/shannon/backup -T /home/shannon/backup -x /dev/sda1 -x /dev/sda2 -9 -f /dev/sda -l GRUB


-O tells Mondo to do a backup.
-V tells Mondo to verify the results. This won't work on a laptop unless you save the images to hard disk.
-i tells Mondo that I am backing up to the hard drive, using .iso images.
-s specifies the size of the images in megabytes (m). 4480 is recommended for DVD images on single layer media.
-d is the destination for the image files.
-I is what to back up or include. Specifying / will back up the whole system, minus the obvious exclusions.
-E is what you don't want backed up. You can repeat this with as many specific directories as necessary.
-T is where to set the temp directory. You don't really need to specify this usually.
-x is telling Mondo that the device that follows should be backed up as a Windows NTFS partition, using NTFSclone. You can specify as many such partitions as you need to, or leave it out if you have no Windows partitions to back up.
-9 is telling Mondo to use maximum compression.
-f is the device that the system boots from. Usually this is auto detected, but if Mondo can't understand your boot sector, you might need to specify this.
-l is the boot loader you want to use. Again, usually auto-detected, but in case...

man mondoarchive will give you a lot more options.

Restoring with Mondo

You can restore from a live system to restore things that you want, or you can restore from the bootable first disc. Your restore options, from the bootable first disc, are NUKE, INTERACTIVE, COMPARE and EXPERT.

NUKE is for a fully automated restore in which the hard drive(s) are completely erased, re-partitioned, reformatted and then everything is restored to the exact same state it was backed up from.

INTERACTIVE allows you to specify what you want done, or let Mondo do the default. If you change from /dev/hdx to /dev/sdx for instance, new drive bus type, you would need to specify the changes manually by editing the mount list to reflect this change. Mondo makes this easy. You can also change the filesystem format, size of the partitions, and so forth if you like. (Remember that your backed up FSTAB will have to be changed to reflect these changes also if you change the filesystem of the boot partition.) Interactive allows you to restore all, some or none of your backed up files, and choose which files and where to restore to.

COMPARE does not restore anything, but it compares your backed up files against the system that it is an image of. You can verify the viability of your backup set this way, and also discover which files have changed since backup.

EXPERT allows you to do whatever you like before you manually invoke the restore sequence.

Mondo can also be used for incremental backups. This is the command I use to do that:


mondoarchive -Oi -d /home/shannon/backup -s 4480m -9 -D -E "/home/shannon/backup"
-O is "make a backup".
-i sends the backup to an .iso on the hard disk.
-d is where to back up to.
-s is the size of the images.
-9 is the compression level (maximum).
-D tells it to make a differential backup.
-E is what to exclude from backup.

To restore differential backups, you simply restore the main backup, and then sequentially layer the differentials on top of it, replacing the files with newer versions as you go.

Mondo Archive has saved my business multiple times where even the likes of Ghost and Acronis True Image have failed me. (What good is a backup that cannot be restored because of an error in making the backup that the program ignored, but which stops the restore process?) Mondo Rescue is the ONLY program I have found that is able to back up every popular linux file system, as well as Windows 9x and higher (FAT and NTFS), and be both accurate and fault tolerant. Mondo is, in my experience, AMAZING, and has literally saved me tens of thousands of dollars. It is used by NASA, JPL, numerous Fortune 500 companies and thousands of other users, and as far as I can see, it is the best backup solution out there. 



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.