Types of Emergency Recovery System

The challenge in creating an emergency recovery system is in putting Linux on a bootable medium that's probably much smaller than a typical Linux system. Fortunately, most emergency recoveries require just a handful of utilities—fdisk, filesystem tools, an editor, tar or other backup and recovery tools, and so on. An emergency recovery system doesn't need big programs or sets of programs such as TeX, Mozilla, KDE, or the like. Nonetheless, some emergency recovery systems come on large media and include some of these tools. Common forms for emergency recovery systems include floppies, CD-ROMs, higher-capacity removable disks, and spare Linux installations. In all cases, you can either create your own custom emergency recovery system or use a ready-made system. (This distinction isn't very substantial in the case of spare Linux installations, though.)

Emergency Floppy Disks

The smallest medium for emergency recovery systems is a floppy disk. This fact makes floppy-based emergency recovery systems very Spartan; they're not likely to include the X Window System (X) or other large packages. Nonetheless, floppies have an advantage because they're available on almost all computers, particularly in the IA-32 world. (Some Macintoshes lack floppy drives, though.) What's more, computers that have floppy disk drives can almost always boot from a floppy disk. Systems made before the late 1990s may not be able to boot from anything but a floppy disk or a hard disk, which can complicate the use of some other recovery media.

A typical Linux kernel is roughly a megabyte in size—large enough that it fills most of a single 1,44MB floppy disk. This fact means that many floppy-based emergency systems come on two or more floppy disks. Some use unusual formats to squeeze a bit more capacity out of a floppy, such as 1,72MB rather than 1,44MB. These formats tend to be more delicate than normal formats, so you're more likely to find that these floppies have gone bad after a time than would be the case with normal 1,44MB floppies. Therefore, I recommend making at least three copies of any floppy-based emergency recovery system. You may also want to store these copies in different locations—say, one in your desk drawer, another in an office down the hall, and a third at an off-site location along with your off-site backups. You should test these floppies periodically to ensure that they're readable, and replace them when necessary.

You can create or find emergency floppy images in several different ways:

Create Your Own Creating your own emergency floppy system requires intimate knowledge of how Linux boots, what tools are required to use it, and so on. Therefore, creating your own emergency floppies isn't for the faint of heart. One way to proceed is to use another system, such as the ones described next, as a starting point. Modifying a working system is almost always easier than creating a new one.

Distribution-Provided Emergency Systems Many distributions provide an emergency recovery floppy disk image or images on their CD-ROMs. You can use these to perform basic recovery operations. Consult your distribution's documentation for details.

Warning Many distributions allow you to create an emergency boot floppy that's designed to boot the distribution in case of a failure of the boot loader. This tool isn't the same as a full emergency recovery system as described here; it won't do you any good if your installation is seriously damaged beyond a boot loader or kernel file problem. Don't assume you're protected just because you created such a floppy when you installed Linux.

Tom's Root/Boot Disk This tool is a custom single-floppy emergency recovery disk for IA-32 systems. You can obtain it from http://www.toms.net/rb/. The system was designed from the start with emergency recovery in mind; it includes the smallest binaries available along with the tools needed for many emergency recovery situations.

pLinux This tool is another single-floppy Linux distribution, similar in concept to Tom's Root/Boot Disk. Check its web page, http://mulinux.nevalabs.org, for more details.

Crash Recovery Kit There are actually several Crash Recovery Kit packages based on different kernel versions and available in different sizes. These systems are built from a Red Hat core, and so should be familiar to Red Hat users. You can read more at http://crashrecovery.org.

Bootable Removable Disks

A step up from an emergency system on a floppy disk is an emergency system on a higher-capacity removable disk, such as a Zip disk, a Jaz disk, or even a removable hard disk. Depending on the disk capacity, you might or might not have room for such niceties as X or a hefty editor such as Emacs.

ZipSlack and BigSlack are a pair of distributions that are particularly well-suited for use on removable disks. (Both are headquartered at

http://www.slackware.com/zipslack/.) These distributions are trimmed-down versions of Slackware Linux. ZipSlack is designed to fit in about 100MB, whereas BigSlack requires 850MB. Both install to FAT partitions using the Linux UMSDOS filesystem, so you can install them on an emergency medium from DOS or Windows in a pinch, although setting them up from Linux is easier.

You can try installing other distributions onto a removable disk. Linux treats such disks as removable hard disks, so in principle the installation process is much like installing to a regular hard disk. Many distributions have problems installing to anything as small as a Zip disk, though. You can accomplish the task with Debian or Slackware. There are also small distributions, such as Peanut Linux (http://www.ibiblio.org/peanut/), that are likely to work well on smallish removable media.

In order to boot Linux from a removable disk, you'll need one of three things:

BIOS Support for Booting from a Removable Disk If your computer's Basic Input/Output System (BIOS) supports booting from a removable disk, you can configure it to do so and boot from your emergency system. Of course, that system must then have a working Linux Loader (LILO) or Grand Unified Boot Loader (GRUB) installation on its boot sector. Most modern computers can be configured to boot from a removable disk, but this support may work only with ATA disks.

Boot Loader on a Floppy If your computer's BIOS doesn't support booting directly from a removable disk, you may be able to work around the issue by placing LILO or GRUB on a floppy disk and configuring the boot loader to redirect the boot process to the removable disk. This practice still relies upon the BIOS at least recognizing the removable drive, though, so it may not work with external drives.

Boot Floppy If all else fails, you can put the Linux kernel directly on a boot floppy. You can either use a bootable DOS floppy and LOADLIN to load the kernel or save the kernel "raw" to the disk, in which case it boots and looks for Linux wherever it's configured to do so.

Bootable Emergency CD-Rs

Because CD-Rs have so much capacity, Linux systems that run from a CD-R can include many niceties, such as X, GUI configuration tools, and so on. Bootable Linux CD-Rs have become common both as emergency systems and as demo systems. You can use a demo system as an emergency recovery system if you like.

One problem with emergency CD-Rs is that they can be difficult to modify. For instance, adding software such as BRU to a CD-R can be more difficult than adding BRU to a removable disk emergency recovery system, because you must copy the files that comprise the emergency system to your hard disk, add the BRU files, and burn a new CD-R. You must also ensure that the new system is bootable.

As with emergency recovery floppy disks and larger removable media, there are several sources of emergency CD-Rs, including:

Distribution CD-Rs The CD-ROMs or CD-Rs that you use for installing Linux may boot into an emergency mode. Sometimes these modes are equivalent to emergency boot floppies. For instance, if you type linux rescue at the lilo: prompt in Red Hat's installer, it boots into what is effectively an emergency floppy system. Other distributions come with or make available fuller demo systems. For instance, SuSE makes a "live-eval" version of its distribution available on a downloadable CD-R image.

DemoLinux This distribution is specifically designed as a demo version of Linux; it boots from CD-R and runs a substantial subset of normal Linux tools. DemoLinux is roughly equivalent to SuSE's live-eval CD-R image. The English DemoLinux home page is http://www.demolinux.org/en/index.html.

Crash Recovery Kit This system, described earlier in "Emergency Floppy Disk," is available on a CD-R image as well as on a floppy disk.

The CD-R version, of course, includes many more niceties.

Most computers made since the mid-1990s can boot from their CD-ROM drives, so booting these distributions shouldn't be a problem. If by chance you can't boot from the disc, you can probably create a boot floppy from files on the disc. Check its documentation for details.

Spare Linux Installations

A final approach for emergency systems is to create a spare Linux installation on your main hard disk. Instead of installing Linux once, you install it twice, once with a full complement of tools and again with a slimmer assortment. Your main system's /etc/fstab file shouldn't automatically mount the second system's partitions, so they won't be damaged should a software error wipe out the main system. In such an event, you can select the emergency system in your boot loader and be up and running fairly quickly, with any luck.

Note The effective difference between a spare Linux installation and an installation to a removable disk is very slim. From a logical standpoint, the two approaches are identical, aside from the fact that the removable disk is removable.

The main problem with the spare installation approach is that it doesn't protect you against catastrophic hardware failure. If your hard disk dies or if the computer is stolen, a spare installation won't do you any good. Nonetheless, it can be a convenient approach for helping to recover from less drastic problems. For this reason, it's a good method to use on a system with which you frequently experiment—for instance, a test system on which you try new software and techniques. Such systems are more likely to suffer from problems such as damaged boot files, and so can benefit from the quick recovery possibilities that a spare Linux installation offers.

A variant on this approach, to be used only after disaster strikes, is to create a new minimal installation from which you can direct more extensive recovery efforts. For instance, suppose you've created a backup and tested an emergency system, and your computer is stolen or seriously damaged. You buy a replacement computer but find that your emergency system doesn't work with it—for instance, the emergency system's kernel might lack support for your hard disk controller. In such a case, you can create a small emergency system on the new disk by installing ZipSlack, BigSlack, a small Debian system, or some other small Linux system. This system should provide enough tools to enable you to restore your backup. With luck it will boot, but if not, the emergency system should give you the tools to build a new kernel or otherwise troubleshoot the problem and get the restored system up and running.

0 0

Post a comment