Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Open Source

Boot a Dead PC with Nothing but a Thumb Drive


Eleven Steps Toward a Bootable USB Key Drive

Let's walk through creating and configuring a USB key drive for use as a computer system recovery solution. Here are the 11 steps:

  1. Download the SYSLINUX suite from the SYSLINUX Web site.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.


  8. 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.

  9. 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.

  10. Repeat steps 6 and 7 for additional boot images, which may alternatively end in .igz for a gzip-compressed (.gz) image (.img) file.

  11. 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.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.