Mondo Rescue and Mindi Linux HOWTO


Chapter 9. Restore


9.2. Restore-Related Tips

Ideally, restore your system to a spare hard drive to test the integrity and reliability of your disks. To do that, either edit your mountlist to make the devices point to your spare hard drive, or swap your hard drive cables between boots.

At a bare minimum, compare your CD against your file system before you decide whether to trust them.

To test Mondo's ability to handle your LILO or GRUB boot loader and accompanying configuration file:

bash# mondorestore --mbr

bash# mount-me
bash# chroot /mnt/RESTORING
bash# lilo OR grub-install '(hd0)'
bash# exit
bash# unmount-me

9.2.1. Barebones (Nuke) Restore

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.

If you want to wipe everything and restore your whole system from CD, please:

That's it. The restoration process for tape or NFS users is similarly easy: just boot, answer the on-screen prompts, and wait.

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 run mondorestore in Interactive Mode and say 'no' when asked if you want Mondo to partition/format your drives.

If you want to see exactly what Mondo is doing while it is restoring, press <Alt><left cursor> to view its logfile, in a virtual console, scrolling past.

9.2.2. Interactive Restore

Interactive Mode is for people who have lost a subset of data from their live file system, 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 restore only some files or if you do not want to prep/format your drives, then you should boot into Interactive Mode. The interactive mode will provide an 'Editing mountlist screen' that allows you to setup a different disk geometry.

To move up and down between partitions in the 'Editing mountlist screen', use the Up and Down arrows. To move between the main window and the buttons at the bottom, use the Left and Right cursor keys. TAB shifts focus from one screen item to the other in a haphazard fashion, owing to the complexities of the Newt library.

If you want to restore selectively, just press <enter> and follow the on-screen instructions. You will be asked to say yes/no to a range of questions.

If you are planning to modify your partition table, you would do well to read up on the partition layout and the use of fdisk, it gives you some could pointers on how to best lay out partitions. You can find good guide her.

If you want to restore a subset of the backup then:

bash# interactive 

Do you want to partition your devices? no
Do you want to format them? no
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

9.2.3. Expert Restore

If you are planning to modify your partition table, you would do well to read up on the partition layout and the use of fdisk, it gives you some could pointers on how to best lay out partitions. You can find good guide her.

To restore manually, please:

bash# expert 

bash# mondorestore

9.2.4. Modified partitions - Restore to a different disk geometry

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.

If the user excluded a particular partition from backup and specifically excluded it from the mountlist itself using -E then Mondo will insert a small (32MB) partition at restore-time, in order to avoid having to re-jig fstab, the partition table, etc.

To do this:

bash# mondorestore

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.

Mondorestore will try to 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.

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 HOWTO) and then write a mountlist like this:

/dev/hda1 /mnt/windows vfat 6096000
/dev/md0 / reiserfs 9123000
/dev/md1 /tmp xfs 955000
/dev/md2 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 using mondorestore's built-in editor then you may choose 'OK'. Please note that this will not write anything to your hard disk. You will only reformat or repartition your disks if you say 'Yes' when asked if you want to do those things.

9.2.5. Advanced

It is now possible to restore to a live filesystem using Mondo. In other words, you do not have to boot your PC from your CD/floppy in order to restore files. Mondo was originally designed for disaster recovery - situations in which you cannot boot your PC. If you can boot your PC, it is not really a disaster, is it? :) Well, if you have wiped out your priceless collection of "MTV's Bjork Unplugged" MP3's, perhaps it is. Anyway, just type this as root

bash# mondorestore

Choose your type of backup media. The live restoration process is very similar to what you'll experience if you type mondorestore with no parameters after booting from a Mondo CD/floppy.

Hit 'OK' when you have inserted the tape/CD. If you generated a tape backup, the tape itself should be enough. If you generated a CD backup, the first CD should be enough. Otherwise, you may need the boot floppy.

Flag the files and directories you wish to restore. Use the 'More' and 'Less' buttons to open and close subdirectories.

Specify the location to restore the files to. In general, '/' is appropriate. If you do not want to overwrite newer versions of the files you are restoring then specify /tmp/BKP or similar as the restore path.

Mondorestore will retrieve configuration information from the media. (The sample screen is for tape users. CD users will see something different.)

Data will be restored to the hard disk - first the regular files, then any big (32MB or greater) files in the restore set.

I hope this manual is proving to be useful to you.