Roll Your Own Multiboot USB Flash Drive
How To Create Your Own Multiboot USB flash drive
For the longest time when I do computer repair house calls, I often depended on a satchel full of CD’s with my favorite tools on them.
Some of them being ERD Commander, Ultimate Windows Boot CD, Knoppix Live, Ubuntu Live, NTpassword, and so on. I hated to have all these cd’s with me at all times.
I often thought about how to accomplish this, but always got sidetracked.
Recently I made up my mind and said the ultimate goal was to have a bootable USB flash drive with a nice menu. I fiddle with this for at least two months with little to no headway, but alas I figured out how to do it and I would like to share it with all of you techies out there willing to read my blog.
I am going to teach you what I have learned throughout this process, and I’m sure you will feel technically empowered when this is all done.
Today you are going to build a USB Multiboot toolset complete with customized boot menu ready to launch many of your favorite tools.
Are you Ready? Good, lets get started!
Creation
First we are going to need a few tools to get started.
- USB flash drive
- grubinstgui
- grub4dos
- memdisk
- 7zip
Any USB flash drive should work. I first used a Kingston DataTraveler 4 GB. Then I later used a PNY 8 gig Flash Drive. Currently I am using this bad boy right here the Kingston DataTraveler 150 – 32 GB USB
Prepare the USB drive by formatting the drive fat32. You can do this in Windows Disk Manager
To get to Windows Disk Manager in windows right click on My Computer and choose Manage from the context menu.
Next look for disk management. In here you should see your USB flash drive. Select it and right click on it and choose format.
Next what you will need to do is run grubinst_gui.
Select the disk option and pick your USB drive. Be SURE to select the correct drive number.
If you’re not sure which drive is your USB drive check with Windows Disk Manager.
You should see your main hard drive as 0 and maybe your USB drive as 1, look carefully as this next step could erase your hard drive and I am not responsible for your laziness.
Read … Read… and Re-Read….
Once you are assured the correct drive is selected, go ahead and click Install.
No options need to be checked, the defaults are fine.
You will then need to copy the grldr file from the grub4dos package to the root of your USB drive. Also while you are at it copy memdisk to the root of the USB drive.
Finally finish off the install by creating a blank text file in the root of your USB drive called “menu.lst”.
Ok this USB flash drive is now bootable, so let’s move on to adding all our favorite tools and toss those cd’s.
For most of the distributions I added, I started off with an ISO version of it. I then extracted the ISOs using 7zip either to my desktop or directly to the root of the thumb drive (or you could just copy the files from a burnt version of the distro, just as long as you get the files to the root of your thumb drive).
Most Linux distros come with 2 folders: a boot folder and another folder that actually holds the meat and potatoes of the distro.
Since it would be impossible to have 6 or 7 different boot folders that don’t overlap on the same thumb drive (without multiple partitions…a route I tried to take for way too long before I realized the magic of grub) I simply renamed the boot folder to something like “bootbt3″ (backtrack3) or “bootknop” (knoppix) depending on the distro, and just left the other folder as is.
I did this at first and had lots of issues with some distros, then I read a little more about grub and realized I could boot the iso, so I will save you tons of time for some of the problem distros and show you how to boot the ISO.
Here is my menu.lst feel free to copy and tweak it. Download it here
splashimage /bgimage/yourimage.xpm.gz
color blue/black yellow/blue
timeout 120
title Hiren’s Boot CD ver 10
kernel /memdisk
initrd /HBCD/boot.gz
title Ultimate Boot CD For Windows
map (hd0,0)/UBCD.iso (hd32)
map –hook
chainloader (hd32)
boot
title BackTrack 4 Linux Penetration and Security
root (hd0,0)
kernel /bootbt4/vmlinuz persistent vga=0×317 ramdisk_size=6666 root=/dev/ram0 rw quiet
initrd=/bootbt4/initrd.gz
boot
title Ubuntu 9.04 Desktop
find –set-root /ubuntu904.iso
map /ubuntu904.iso (0xff)
map –hook
root (0xff)
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/ubuntu904.iso quiet splash locale=en.UTF-8 –
initrd /casper/initrd.gz
boot
title Puppy Linux
root (hd0,0)
kernel /puppy/vmlinuz root=/dev/rd/0 pmedia=usbflash
initrd /puppy/initrd.gz
title Gparted 0.4.5-2 Partition Editor
root (hd0,0)
kernel /gparted/vmlinuz1 live-media-path=/gparted bootfrom=/dev/sd boot=live union=aufs noswap noprompt vga=789 ip=frommedia
initrd /gparted/initrd1.img
title Ophcrack (Password Revealer, Resetter, Cracker)
kernel /bootoph/bzImage rw root=/dev/null vga=normal lang=C kmap=us screen=1024x768x16 autologin
initrd /bootoph/rootfs.gz
#this is for a space
title
kernal
initrd
title Restart The Computer
reboot
If you will notice in the menu.lst above, I didn’t use an ISO for every single one.
Not all distros boot well from ISO on a USB flash drive, so I had to extract some of them.
For Hiren’s boot CD I extracted the ISO with 7zip and copied the contents to the root of the USB flash drive as HBCD.
For the Ultimate Boot Cd for Windows you can see I booted the ISO. I just copied it to the root of the USB flash drive.
For Backtrack 4 beta I extracted it using 7zip and copied the bt4 folder to the root and also renamed the boot folder to bootbt4
For Ubuntu 9.4 you will see that I used the ISO
For Puppy Linux I extracted the ISO (this one was just for fun, its FAST!)
For Gparted I extracted the ISO to Gparted folder on the root of the USB flash drive.
For Ophcrack I extracted the contents to the folder called bootoph and I also put the tables folder on the root of the USB flash drive.
Here is what the Root of my USB Flash Drive looks like
>USBSTICK
|->bkgrimage
|->USBlogo.xpm.gz
|->bootbt4
|->bootoph
|->BT4
|->dban
|->gparted
|->HBCD
|->memtest
|->STORAGE
|->ntpasswd
|->puppy
|->tables
grldr
memdisk
menu.lst
UBCD.iso
ubuntu904.iso
ghost11.iso
ERD60_x86_WinVista_SP2.iso
ERD60_x64_WinVista_SP2.iso
Add what ever you wish to add to this USB flash drive. You can refer to my example and some of the grub manual for details on how to boot different distros.
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. Gimp is like Microsoft Paint on Steroids for Linux users. Once you have the files on your USB flash drive you can boot into Ubuntu and use gimp from there. Just acquire yourself some sort of image 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. To gzip it in Ubuntu right click the image and create archive. Choose .gz from the drop down beside the name of the file. Copy the gz to the root of your USB flash drive and prepend “splashimage /image.xpm.gz” to your menu.lst file. I inserted another USB Flash Drive in and copied it to that one whilst in Ubuntu.
If you dont want to mess with all that Download mine here

Further information on customizing the grub menu.lst file for your specific distros can be found in the grub manual.
Ok now that our files are in place, wouldn’t it be nice if you could mess with it for testing without having to reboot all the stinking time?
Well…there is an app for that….its VMWARE player and its free.
This way you can test your USB flash drive in a virtual environment without having to reboot your computer. That way you can continue to read my blog.
USB-TestVM -> http://userbytes.com/extra/USB-TestVM.zip
VMware Player direct download -> http://download3.vmware.com/software/vmplayer/VMware-Player-2.5.3-185404.exe
Tools I use:
- Backtrack 4 Beta (the backtrack login is root/toor
- Ultimate Boot CD for Windows
- Ophcrack
- Ubuntu 9.04
- NTpasswd
- MemTest86
- Hirens Boot CD
- Gparted Partion Manager
- ERD Commander Now a Microsoft Product
Some of these tools are downright dangerous in the wrong hands. It would be terrible if say you were an IT Specialist at ohh I dunno… a “college” and you forgot it in one of the computers one day, and a student got their hands on it and used it for malicious mischief. YIKES !!!
Well I have an idea for that as well.
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.
UPDATE -11-20-2009
I took the liberty of creating you one in case you didnt want to do all that. You will need to copy and paste the following in your menu.lst
$1$DnF0$t0Mb7RQFOfYgaTV13mY7t0
That is the md5 encryption for the password userbytes.com …..once again in case you missed it, the password is userbytes.com
You will want to place it 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
And 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
boot
This way if someone discovers your USB swiss army knife, this will slow them down a great deal.
There are many benefits to having one of these. Not only can you rescue computers, but you could also us it as a means to get on the internet while you are on vacation. Just insert the usb flash drive in one of those computers that you use in the hotel business office, and reboot into Ubuntu or Puppy Linux. This way you can securely check your banking and leave no tracks.






Got it, All the references I was finding were using BT3, or BT4 Beta which looked like BT3
I was also wanting to put each distro on a seperate partition so that I could not have to rename the dir’s and have possibly more problems as a result of the path being different.
Below is the menu.lst statements that work!
title start BackTrack FrameBuffer (1024×768)
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw quiet vga=0×317
initrd /boot/initrd.gz
title start BackTrack FrameBuffer (800×600)
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw quiet vga=0×314
initrd /boot/initrd800.gz
title start BackTrack Forensics (no swap)
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw vga=0×317
initrd /boot/initrdfr.gz
title start BackTrack in Safe Graphical Mode
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper xforcevesa rw quiet
initrd /boot/initrd.gz
title start Persistent Live CD
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper persistent rw quiet
initrd /boot/initrd.gz
title start BackTrack in Text Mode
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw quiet
initrd /boot/initrd.gz
title start BackTrack Graphical Mode from RAM
root (hd0,1)
kernel /boot/vmlinuz BOOT=casper boot=casper toram nopersistent rw quiet
initrd /boot/initrd.gz
title Memory Test
root (hd0,1)
kernel /boot/memtest86+.bin
Good luck guys!
Hi, I need help with the list
splashimage /zbackground.xpm.gz
color blue/black yellow/blue
timeout 120
title Partition Master v6.01 Server Edition
map (hd0,0)/PartitionMaster.v6.01.Server.Edition.iso (hd32)
map -–hook
chainloader (hd32)
boot
title MemTest x86 v.4.10
map (hd0,0)/memtestx867_mt410.iso
map –-hook
chainloader (hd32)
boot
title Acronis True Image Home 2010
map (hd0,0)/AcronisTrueImageHome2010_s_en.iso (hd32)
map –-hook
chainloader (hd32)
boot
title Ultimate Boot CD For Windows
map (hd0,0)/UBCD4WinBuilder.iso (hd32)
map -–hook
chainloader (hd32)
boot
No luck. Always in all of them I get the Error 12 Unrecognized device string. The files are placed in the root of the USB stick and the file names are ok.
hi,
I’m having some trouble with the configuration of my grub on the disk. you see, when i boot up to the disk, grub goes directly to cmnd line interface. i’m using a diferent usb drive, mine’s a cruzer micro 4gb. here’s the menu.lst, tell me if you see anything funky please.
splashimage /bgimage/USBlogo.xpm.gz
color blue/black yellow/blue
timeout 120
title Ultimate Boot CD For Windows
map (hd0,0)/UBCD.iso (hd32)
map –hook
chainloader (hd32)
boot
title BackTrack 4 Linux Penetration and Security
root (hd0,0)
kernel /bootbt4/vmlinuz persistent vga=0×317 ramdisk_size=6666 root=/dev/ram0 rw quiet
initrd=/bootbt4/initrd.gz
boot
title Memtest86 (Memory Tester)
kernel /memtest/ISOLINUX/MEMTEST
title Ophcrack (Password Revealer, Resetter, Cracker)
kernel /bootoph/bzImage rw root=/dev/null vga=normal lang=C kmap=us screen=1024x768x16 autologin
initrd /bootoph/rootfs.gz
title
kernal
initrd
title Restart The Computer
reboot
THANK YOU
sry, my menu saved as menu.lst.txt
now i have a whole new problem
it says dev/ram0 doesn’t exist i’m not sure what this part of the code means.