Let's walk through creating and configuring a USB key drive for use as a computer system recovery solution. Here are the 11 steps:
- Download the SYSLINUX suite from the SYSLINUX Web site.
- Obtain a copy of the RIP Linux ISO distribution. RIP can be downloaded from this Recovery Is Possible Linux rescue system page on Tux.org.
- Open the local ISO image and extract the mkusb.sh script for Linux or mkusb.bat for Windows. (This Recipe uses Linux-specific commands, but the Windows procedure is roughly the same.) Copy the script to a temporary working directory along with the RIP Linux ISO.
- Run the script as depicted in the screenshot below. In a matter of minutes the USB key will receive a fresh Linux installation. Be sure to identify the appropriate USB device label in the BIOS, as the RIP USB scripts will automatically select the first available drive assuming it is the default USB drive entry and proceed to irreparably modify the corresponding partition entry.
At this point, RIP Linux is ready to operate directly from the USB key. The next screenshot illustrates what's necessary for the initial bootable USB image:
Included recovery applications are limited to what the RIP distribution provides. Although well populated with a number of handy applications, RIP does not provide vendor-specific diagnostic tools to troubleshoot a misbehaving disk drive for example.
The next series of steps demonstrates the process of including additional boot images to the USB key.
- Under Linux, the drive partition will be un-mounted—that is, not visible as a world-accessible drive partition. Remount the drive or disconnect and re-plug the USB key to trigger hardware auto-detection facilities to mount the partition.
- Obtain or create the desired boot floppy image(s) (.img or .igz). For example, an image named my-diags.img. Copy this file directly into the main directory on the USB key.
- Open the syslinux.cfg file with your favorite text editor (such as vi, emacs, or joe) and scroll down to the section where the first LINUX (or lowercase linux) directive is issued, as the following screenshot shows.
- For every boot disk image, there is a corresponding SYSLINUX configuration entry. Each entry has the same basic format:
LABEL [entry] KERNEL [image] APPEND [value]
Where [entry] corresponds to the boot-time image entry, [image] refers to the image boot loader, and [value] includes any additional boot-time parameters. Format this accordingly:LABEL my-diags KERNEL memdisk APPEND my-diags.img
The above entry is formatted using our fictitious example values.
- Copy the memdisk boot image to the USB key. This critical file can be found wherever SYSLINUX sources are installed. On a default Fedora Core installation, this happens to be situated in the /usr/lib/syslinux directory.
- Repeat steps 6 and 7 for additional boot images, which may alternatively end in .igz for a gzip-compressed (.gz) image (.img) file.
- Reboot the computer, and trigger the BIOS setup key. This varies by manufacturer, but is commonly the Delete + Escape + Function keys, or some combination thereof. Once in the BIOS, seek out the boot priority or hard-disk sequence settings, and make the USB key boot first.
Although the initial RIP image is only 72 MB big, the USB key can quickly grow to several hundred megabytes with the addition of more drivers, images, and tools. The beauty of this is they can all be added while the system is booted to the X Windows desktop from the USB key, which happens to contain the latest version of the Firefox Web browser.