Mondo
Rescue v1.10
and
Mindi
Linux v0.37
Manual by
Hugo Rabson
08/08/2001
Contents
Restore to a different disk
geometry
If you are installing from a tarball then copy it to /tmp and type:-
# cd /
# tar –zxvf
/tmp/mindi-0.37.tgz
# cd mindi-0.37
# ./INSTALL
Or, if you are installing from an RPM then copy it to /tmp and type:-
# rpm –Uvh /tmp/mindi-0.37-1.i386.rpm
If you are installing from a tarball then copy it to /tmp and type:-
# cd /tmp
# tar –zxvf mondo-1.10.tgz
# cd mondo-1.10
# ./INSTALL
Or, if you are installing from an RPM then copy it to /tmp and type:-
# rpm –Uvh /tmp/mondo-1.10-1.i386.rpm
Run Mindi to create some boot disks, just to make sure Mindi works properly on your system. Type:-
# cd /usr/share/mindi
# ./mindi
If your kernel is too large (more than about 900KB) then you cannot make boot floppies, although you can still make a bootable CD image. The easiest way to test Mindi in either case is to say ‘n’ to its first question and ‘y’ to its second, then use cdrecord to make a bootable CDR or CDRW.
# cd /root/images/mindi
# cdrecord –scanbus
The output of the above call to cdrecord will tell you your CD writer’s node. It is usually ‘0,0,0’. Choose one of the following calls to write the CD, depending on whether the disk in the drive is a CDR or a CDRW. Please replace ‘x,x,x’ with your writer’s node.
# cdrecord –blank fast dev=x,x,x speed=2 mindi.iso (for CDRW) [or]
# cdrecord dev=x,x,x speed=2 mindi/mindi.iso (for CDR)
Close all applications; reboot from the CD instead of the hard disk. (You may have to edit your BIOS settings to make your computer try to boot from the CD before the hard drive.) If your computer boots okay from the CD, and finishes up with, “Expert Mode – you do all the work J” then you know Mondo will also generate a bootable CD reliably. Finally, reboot from your hard drive.
Now, backup your system. Type:-
# cd /home
# mondo-archive --burn-cds 2 x,x,x cdrw (for CDRW)
or
# mondo-archive --burn-cds 2 x,x,x (for CDR)
Replace x,x,x with the node of your CD writer. Replace 2 with the writer’s speed. Please insert the first disk in the writer while the PC is chugging away. If Mondo needs additional CDR(W)’s then it will ask for them.
Boot from the first CD. Type compare <enter>. Follow the on-screen instructions. This will compare your backup against your original filesystem. FYI, no data loss has been reported since May 2000. Having said that, I would still encourage you to run Compare before trusting the backups.
If you want to wipe everything and restore your whole system from CD, please boot from the first CD and type nuke <enter>. Insert subsequent CD’s when asked. Watch the screen for errors. That’s it.
If you want to restore selectively, just push <enter> and follow the on-screen instructions.
To restore manually, please boot from the first CD and type expert <enter>. Then, type the following:-
# pico /tmp/mountlist.txt (edit the mountlist)
# prep-me (format your drives)
# mount-me (mount the drives)
# restore-me (restore everything)
# stablilo-me (run LILO)
# unmount-me (unmount drives)
Pico is a text editor. You may edit the layout of the partitions, the sizes and the formats before you format and restore them. If you have added a hard drive, list it here. If you want to move from ext2 to ReiserFS, you can do it here (so long as your kernel supports ReiserFS). Ditto for XFS, JFS or ext3. Stablilo-me will modify your /etc/fstab to reflect changes you have made to the mountlist. If you are not using LILO, you can still create your own /mnt/RESTORING/etc/lilo.conf and run lilo –r /mnt/RESTORING to configure your boot sectors and Master Boot Record.
If you want to restore a subset of the backup then boot from the CD and type interactive <enter>. Then, after booting, answer the questions as follows:-
Do you want to partition your devices? |
yes |
Do you want to format them? |
yes |
Do you want to restore everything? |
no |
Do you want to restore something? |
Yes |
Which path do you want to restore? |
/home/hugo [e.g.] |
Do you want to run LILO to setup your boot sectors? |
Yes |
Your computer must have:-
- Intel®-compatible CPU
- 64MB of RAM (128MB recommended)
- 800MB of hard disk space free
- CD Writer (preferably a Rewriter)
Your kernel must have:-
- stable loopfs support, which means it really needs to be 2.2.19 or 2.4.7 (or later)
- CD-ROM device support
- ISO9660 filesystem support
- initrd ramdisk support (built in)
- floppy disk support (built in)
- ext2 filesystem support (built in)
- CD-RW support, including SCSI emulation
Mondo backs up your filesystem to CD’s. In the event of catastrophic data loss, you may restore some or all of your system from those CD’s, even if your hard drives are now blank. It can do a lot of other cool things:-
Mondo’s principal virtue is that it protects you from the problems that can arise when you reinstall completely from scratch. If you want to wipe and restore your system every year just as a matter of ‘good practice’, Mondo is not for you.
Mindi creates a set of boot/root floppy disk images that will let you perform basic system maintenance on your Linux distro. What are the principal virtues of Mindi’s boot disks?
Whichever modules were loaded at backup-time, they are reloaded at boot-time. So, in theory, you will boot into almost the same environment as you were in when you backed up.
If you want to add files to your Mindi boot disks, edit ‘/usr/share/mindi/deplist.txt’ and add the files to that list. They, and their dependencies, will be spread across the data disks at run-time.
Mama does Mondo… Papa does Mondo… Is that a Dean Martin song? Well, anyway,
here is how I backup my system:-
# cdrecord –scanbus
# cd /home
# mondo-archive --burn-cds 2 0,0,0 cdrw --comp-level
9
Cdrecord will tell me where my CD recorder lives, in SCSI terms, which in my case is ‘0,0,0’. By running Mondo from my /home directory, I am asking Mondo to use my /home directory for temp storage space. This does not affect your data. Mondo creates a folder called ‘mondo.scratch’ in your home directory; it then deletes it when it is done. Finally, the call to mondo-archive tells Mondo that I want to backup everything to a 2x CD-ReWriter drive that has a CD-RW disk in it. (Drop the cdrw if you are using CD-R’s.)
Please put the first CD-R(W) in the drive now. You will be prompted to insert CD #2 but you will not be prompted to insert the first disk. However, if you forget, do not worry: if Mondo fails to write the first (or any) disk, it will offer to retry, abort or fail.
I run Mondo at the highest compression available and then go to work. I then walk home at lunch (I live right by my workplace), change CD’s, eat lunch, and go back to work. When I get home, it has all been done.
Your mileage may vary. Experiment. Find the speed/compression compromise that best suits your needs.
There are lots of options. When I have time, I shall document them in greater detail here. The most important options are:-
--comp-level level of compression (1=fasters, 9=best)
--isodir the directory where the ISO images will be written – n/a if you are burning CD’s on-the-fly
--burn-cds if you want to burn the CD’s straightaway without storing the ISO’s first, use this switch – syntax is --burn-cds <speed> <SCSI device> (<cdrw>)
--scratchdir specify which directory will contain the files and directories that will go on the current CD (i.e. this is the directory where the CD’s filesystem is prepared)
--tmpdir where global, temporary files go (if you don’t want to use /tmp)
--cd-size how big is the media, in Megabytes? (default=650)
--bkpath which directory/ies do you wish to backup? (default=/)
--exclude-paths which directory/ies do you not wish to backup? (/proc, /tmp, your scratchdir, your isodir and your tmpdir are excluded automatically)
--differential only backup those files changed in the last N days; this is useful if you want to backup your whole system monthly to CD-R (maybe 4 or 5 disks) but keep the month’s changed files on CD-RW (1 disk); you can have a daily backup without wasting hundreds of CD-R’s
--verify do you want to create MD5 checksums and use extra safeguards to verify data integrity (default=0; range=0-3)? Do not bother. Just boot from the CD’s and run them in Compare Mode. That is the only way to be sure of the quality of the backup (apart from restoring to another PC, of course).
Are they from Mindo or Mondo? Mindi does not write to any log, so if you get errors on the screen which relate to the creation of the boot disk(s) and or data disk(s) then pipe that output to a text file and send it to the Mondo mailing list. See the web site – http://www.microwerks.net/~hugo – for details. If you are going to e-mail the list (or me) then please attach that text file and tell me:-
- your kernel version
- your Linux distro’s name and version
- whether your kernel supports initrd and loopfs ßit should!
- what sort of PC you are using, including hard disk configurations
Mondo is freely available, you are given it for no charge and I am giving you technical support in my spare time. When you e-mail me, please bear this in mind.
Before you trust your backup CD’s, make sure your BIOS can boot CD’s (and that it is configured to do so) and then boot from the first backup CD. Type ‘compare’ <enter> to compare the archives against your filesystem. If only a few files differ – e.g. logs, temporary files, /etc/mtab – then you know the archives are good.
I hope you don’t have to restore very often. It’s nerve-wracking… until you realize that Mondo’s restore engine is very reliable. I backup and restore my system 2 or 3 times a week as part of the testing process. I have no other backup regime, so it had better work.
If you find that you cannot make your PC boot from the CD, take heart: the first backup CD of each set contains floppy disk images to give you the same functionality as the CD (minus the archives, of course J) on floppies. Remember, your Mondo CD is a fully functional CD-based mini-distribution as well as a recovery CD.
If you insist on using GRUB, you are on your own. GRUB should be included on the CD by Mondo but I have never been able to make GRUB work properly.
You can choose from the following modes:-
Interactive – restore step-by-step, or restore a subset of the archives
Nuke – wipe your drives and restore everything, automatically and unattended
Expert – boot to a shell prompt
If you want to do anything creative, you should boot into Expert Mode.
Mondo uses afio, not tar, as the archive engine. The archives’ filenames are a bit misleading, seeing as they all contain ‘.tar.’; this will be fixed shortly.
In principle, you could do everything by hand using the Mondo CD as a big mini-distro. You could partition, format, mount and restore the disks yourself. Mondo comes with scripts and tools to automate the process but in a jam you could do everything manually.
Imagine that your hard drives happen to be wiped, deliberately or accidentally. Or, imagine that you want to clone your existing operating system. In either case, you want to run in Nuke Mode. After booting from your Mondo CD, type ‘nuke’ <enter> and watch the show. Twenty minutes later, the job is complete. That’s it.
Now, should something go wrong, you will be able to examine /tmp/mondo-restore.log to see what happened. All is not lost. You can fdisk and format the partitions yourself, using the tools that come with the CD. You can then mount the drives manually and type ‘restore-me’ to restore all data; then run ‘lilo –r /mnt/RESTORING’ to reconfigure the boot sectors; finally, unmount the partitions manually. That is as a last resort. I have never had to do that – at least, not with any published version of Mondo.
If you want to see exactly what Mondo is doing while it is restoring, press <Alt><à> and type ‘tail -f /tmp/mondo-restore.log’ to monitor its progress in detail.
If you want to restore only some files or if you do not want to prep/format your drives, then you should boot into Interactive Mode. Type ‘interactive’ <enter> at boot time. You will be asked to say yes/no to a range of questions.
Do you want to partition your devices?
Do you want to format them?
Do you want to restore everything?
Do you want to restore something?
Do you want to run LILO to setup your boot sectors?
Interactive Mode is for people who have lost a subset of data from their live filesystem, or perhaps who have lost some data from their latest backup and want to restore a subset of data from an earlier backup.
If you want to edit the mountlist (i.e. restore to a different disk geometry) then do not use Interactive Mode. You should use Expert Mode instead.
One of the nice things about Mondo is that it lets you wipe your existing system and restore it in any layout you like (within reason). You can move from non-RAID to RAID, install and utilize additional drives, move from ext2 to ReiserFS, etc., all without risking the loss of data.
To do this, boot into Expert Mode. At boot-time, type ‘expert’ <Enter> and wait for the shell prompt. Then type ‘pico /tmp/mountlist.txt’ to edit the mountlist.
Mondo (technically, Mindi on behalf of Mondo) creates a file called a mountlist. This can be found on the ramdisk at /tmp/mountlist.txt; it looks something like this:-
/dev/hda1 /mnt/windows vfat 4096000
/dev/hda5
/ reiserfs 6023000
/dev/hda6
/tmp xfs 955000
/dev/hda7
/usr xfs 4096000
It is fairly easy to understand the list. Each line refers to a single device/partition. The line format is <device> <partition> <format> <Kilobytes>. If you have added a hard drive and want to take advantage of the additional space, you could amend the above mountlist to read:-
/dev/hda1 /mnt/windows vfat 6096000
/dev/hda5
/ reiserfs 9123000
/dev/hda6
/tmp xfs 955000
/dev/hdb1
/usr xfs 8192000
/dev/hdb2
/home xfs 8192000
This assumes that your old hard drive is /dev/hda and the new hard drive is /dev/hdb.
Or, if you want to add RAID support, create a new /etc/raidtab on the ramdisk (which is beyond the scope of this manual) and then write a mountlist like this:-
/dev/hda1 /mnt/windows vfat 6096000
/dev/md0
/ reiserfs 9123000
/dev/md1
/tmp xfs 955000
/dev/md2
/usr xfs 8192000
/dev/md3
/home xfs 8192000
So long as your /etc/raidtab file is sane, Mondo can automatically partition and format your disks for you, including the RAID devices.
Once you have finished editing /tmp/mountlist.txt (and /etc/raidtab if necessary) then you may run ‘mondo-restore --interactive’.
I shall write more when I have time. This manual is incomplete but accurate to the best of my knowledge. If Mondo eats your data, I shall apologize a lot but I am not to be held liable. I have tested it a thousand times on my own computer with my own data and with no alternate backup regime. It worked for me. If it didn’t work for you, it’s probably your fault. There, is that harsh enough for disclaimer or what? J