MondoRescue HOWTO: Utilisation and Configuration of Mondo and Mindi under Linux (Version 3.2.2-r3752) | ||
---|---|---|
Chapter 9. Restore |
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:
Boot from the backup CD into Expert Mode
Type:
To fix any mess it made (not that it should) type:
bash# mr-mount-me |
bash# chroot /mnt/RESTORING |
bash# lilo OR grub-install '(hd0)' |
bash# exit |
bash# mr-unmount-me |
If it did not work then please copy /tmp/mondorestore.log to to your hard disk, USB key, ..., gzip it and e-mail it to the mondorescue mailing list.
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:
Use the -H option when invoking mondoarchive
Boot from the first Mondo CD
Press RESTORE<enter>
Insert the subsequent CD when asked
Watch the screen for errors
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/mondorestore.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.
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 pointers on how to best lay out partitions. You can find a good guide at the Partition HOWTO
If you want to restore a subset of the backup then:
Boot from the CD
Type:
Then, after booting, answer the questions as follows:
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 a guide at the Partition HOWTO
To restore manually, please:
Boot from the first CD, then type:
Then do whatever you like. :) You may type the following, of course:
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:
Boot into Expert Mode, then type:
(edit the mountlist using the on-screen editor)
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, ext4.
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 ext3 4096000 |
It is fairly easy to understand the list. Each line refers to a single device/partition. The line format is:
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 ext3 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 /usr ext3 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.
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 media 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
I hope this manual was useful for you.