Hack90.Rescue Me


Hack 90. Rescue Me!

So you've tried all the standard tips and tricks to get your system to boot on its own, and nothing has worked. In that case, a bootable Linux system on a CD may be your new best friend.

Hardware failure, filesystem corruption, overzealous upgrades, and significant tweaking of your system's startup process are among the things that can cause your system to fail to boot successfully. Assuming you've gotten to this point and the suggestions in "Resolve Common Boot and Startup Problems" [Hack #89] didn't work out, your next good alternative is to download, burn, and boot from what is known as a "rescue disk."

It's always a good idea to keep a bootable rescue disk handy. Download and burn one before you have problems, so that you'll have one to use should you ever need it.


A rescue disk is a small Linux distribution that boots and runs from a CD and provides the kernel and operating system capabilities that you need to access your hardware, as well as the tools you need to resolve problems with the interaction between that hardware and the desktop or server system you're trying to boot. The things that a rescue disk must provide fall into four general categories:

  • A kernel and drivers for the storage devices attached to your system and, preferably, at least one of the network interface(s) available on that system.

  • Disk repair utilities for various types of filesystems, including logical volume management (LVM) utilities.

  • System utilities such as mount that enable you to access data from the filesystems on the ailing machine, boot tools such as GRUB that enable you to verify (and optionally update) the system's boot process, and so on. These often include the tools used to recover from systems problems, as discussed in "Recover Lost Partitions" [Hack #93] (gpart) and "Recover Data from Crashed Disks" [Hack #94] (ddrescue).

  • Standard utilities, such as a text editor to correct and update text files used by the system during the boot process (such as /etc/inittab), the configuration files used by various services, and the system startup scripts in the /etc/rc.d or /etc/init.d directory (depending on your distribution)

Though there are plenty of rescue disks around, including many graphical Live-CD Linux distributions, my personal favorite for years has been Kent Robotti's RIP (Recovery Is Possible!) disk, available from http://www.tux.org/pub/people/kent-robotti/looplinux/rip/. This is a relatively small (25 MB) rescue disk that does not offer any graphical user interface but does provide a complete set of up-to-date filesystem repair utilities for ext2, ext3, JFS, reiserfs, reiser4, and XFS filesystems, as well as the LVM2 utilities for mounting and managing logical volumes. As a nongraphical rescue disk, it targets experienced sysadmins who are comfortable at the command line, which you should be when trying to rescue or recover data from an ailing system.

10.3.1. Downloading and Burning the Rescue Disk

The two ISO images on the RIP page differ in terms of the bootloaders they useone uses GRUB, and the other uses the standard ISOLINUX bootloader. I prefer to use the latter because it is simpler, so I always retrieve the file RIP-13.4.iso.bin, which is a binary CD image that you can burn directly to CD and then use to boot your system.

The standard Linux command-line CD-burning utility is called cdrecord. Prior to the 2.6 Linux kernel, using an IDE CD writer with cdrecord required the use of a loadable kernel module that provided SCSI emulation for IDE, because cdrecord expected SCSI identifiers when specifying the target output device. With the 2.6 kernel, CD-burning utilities can use ATA CD drives directly, without any special modules.

Once you've retrieved the file, you'll need to identify your system's CD burner(s). To do this, su to root and then execute the cdrecord -scanbus command. This causes cdrecord to probe the system for suitable devices and display the information that you'll need to supply in order to write to them. Here's an example:

 # cdrecord -scanbus Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 J#rg Schilling Linux sg driver version: 3.1.24 Using libscg version 'schily-0.7' scsibus0: 0,0,0  0) 'TOSHIBA ' 'DVD-ROM SD-R1202' '1026' Removable CD-ROM 0,1,0  1) * 0,2,0  2) * 0,3,0  3) * 0,4,0  4) * 0,5,0  5) * 0,6,0  6) * 0,7,0  7) * 

Once you've identified the device associated with your CD burner, burn the CD image to a writable CD-ROM using a command such as the following:

 # cdrecord -v dev=0,0,0 speed=4 RIP-13.4.iso.bin 

This command will produce very verbose output (due to the use of the -v option) and will wait nine seconds before actually starting to write to the disc, just in case you change your mind. Once writing begins, the cdrecord command displays a status line that it continues to update until the entire file is written to the CD.

10.3.2. Using the Rescue CD

Once you've created the rescue CD, you need only put it in the ailing system and reboot. If your system is not configured to boot from the CD drive before booting from a hard disk partition, you may need to change your system's boot sequence in the BIOS settings in order to get the system to boot from the CD.

Once you've booted from the rescue CD, you can quickly and easily perform tasks such as the following:

  • Run standard system repair commands to repair filesystem consistency [Hacks #89and #95].

  • Configure your system's network interface so that you can bring the system up on your network.

  • Create archive files of critical files and directories and transfer those files to other systems using the ncftp utility supplied on the rescue disk.

  • Correct other boot problems [Hack #89].

10.3.3. See Also

  • RIP home page: http://www.tux.org/pub/people/kent-robotti/looplinux/rip/



Linux Server Hacks (Vol. 2)
BSD Sockets Programming from a Multi-Language Perspective (Programming Series)
ISBN: N/A
EAN: 2147483647
Year: 2003
Pages: 162
Authors: M. Tim Jones

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net