Tuesday, 12 June 2012

Create A Multi Boot Rescue CD or USB Flash Drive

When I do Computer Repair or Laptop Repair, I often carry a cd case full of CD’s with my favorite tools on them.
Some of them being ERD Commander, Ghost, Ultimate Windows Boot CD, UBCD4WIN, VistaPE, Knoppix Live, Ubuntu Live, NTpassword, and so on.

I am going to show you how to build a USB Multiboot toolset complete with customized boot menu ready to launch many of your favorite tools.

lets get started!

1 – Preparing the USB stick

You need an USB stick, about 4 GB in size should do it. Be aware that any data on it will be erased, so get your data off of it before starting.

Firstly, Insert the pen drive and open My Computer. Right-click the USB drive and select Format

Now, Select the File System that best suits your needs, and give the drive a name in the Volume label field. I used FAT32. Click Start to format the drive.
Click OK on the warning window. Now the formatting will begin, once done click OK. Your Pen drive is now formatted.

2 – Installing the boot loader

There appear to be many boot loader choices available, I decided to use grub4dos.

Download grub4dos 0.4.4

Download grubinst 1.0.1

Download Memdisk

To install the grub4dos boot loader to the MBR of the USB Stick, run grubinst_gui.exe. Be sure to select the right hard disk (in my case it is hd1, it will probably be different on other system setups), otherwise you might damage your system disk’s boot sector!

Download and extract grubinst then run grubinst_gui.exe
(right click – run as administrator in Vista/Win7)
# From the Grub4DOS Installer:
(1) Select your USB Disk from the drop down
(2) Click Refresh Part List
(3) Select Whole disk [MBR] from the drop down
(4) Click Install

Once you pressed install (it’s really quick) extract the contents of grub4dos 0.4.4 into a folder and copy only the files memdisk, grldr and menu.lst into the root directory of the USB stick. The contents of your stick should look like this right now:

3 – Modifying the menu.lst

Open the file menu.lst from your USB stick’s root folder with a text editor. This file creates the menu you will choose from which program to boot. Presently it’s full of unnecessary stuff, I started by shorting it to this:

    color black/cyan yellow/cyan
    timeout 30
    default /default

    title reboot
    savedefault --wait=2

    title halt
    savedefault --wait=2

Here is my menu.lst feel free to copy and tweak it. Download it here

Every program you want to install needs an entry in this file so that grub4dos knows which program to load and how to do it. Let’s start with MemTest86+!

4 – Installing Software: MemTest86+

Download the Pre-Compiled Bootable Binary of MemTest86+. Place the file memtest86+-2.10.bin into the root of the USB stick. If you don’t want to change the menu.lst every time you place a new version on the stick, rename the file to memtest.bin. Open the menu.lst and add this code to it:

    title MemTest86+
    kernel /memtest.bin

That’s it, next time you boot from the stick you’ll get MemTest86+ as an option in the boot loader.

5 - Customizing

When it comes to customizing the USB menu with a splash image, its simply a matter of creating a 640×480 – 14 color splash screen image.
This is easy to accomplish with the Gimp, Just get yourself some sort of image that you like and place it on the root of your USB flash drive. It needs to be a 640×480 image. You can crunch the colors in gimp by selecting Image, Mode, Indexed and entering 14 as the maximum colors. Click Convert. Save this file as a XPM, then gzip it.

you can use this image I used if you like Download Here

6 - Password

A password can be added by obtaining a UNIX md5. This can be done from Grub by:

1. Booting up the drive and pressing “c” at the grub prompt (you can do this in the VMWARE player)
2. Typing in “md5crypt” then entering in your desired password
3. Copying the resultant md5 hash on paper, etc. ( write it down. If you cant read it because of your splash screen, comment out your splash screen entry with a #  and try again)
4. Adding the line password –md5 *your md5 here* either after the preliminary lines (i.e. – after timeout, splash image, etc.) (This will require a password to make any changes to the menu.lst from the grub prompt) AND/OR after the title of a distro (This will require a password to boot the distro) Sometimes I have had to place it right before the word boot.

You will need to place password at the end of your item to be booted so that it prompts you before the item is booted.
Like this:

title DBAN (Darriks Boot and Nuke, Disk wiper)
kernel /dban/memdisk
initrd /dban/dban.ima
password –md5 $1$DnF0$t0Mb7RQFOfYgaTV13mY7t0

Note: if you have one with “boot” in it, put it before the “boot” like this:

title Ultimate Boot CD For Windows
map (hd0,0)/UBCD.iso (hd32)
map –hook
chainloader (hd32)
password –md5 $1$DnF0$t0Mb7RQFOfYgaTV13mY7t0


Post a Comment

No spam, leave your comment....