February 4, 2009

And now for something completely different – a short tutorial on how to create an USB stick with all (well, at least a few) of the nice bootable rescue and recovery tools that exist today. It’s much more practical than having each tool on a CD, especially if you don’t have a CD drive as is the case with my Thinkpad X60s.

I created it yesterday but had some problems getting every program to boot up properly from the boot loader. That wasn’t surprising since I never did this before and I didn’t really know what I was doing. With the help of Google and many different forum posts I got it to work though. I thought it would be nice to compile all what I learned yesterday to a simple, small tutorial. Keep in mind: I don’t have much insight on how it works and will likely not be able to help with problems, this is simply the way I did it and achieved a working result with.

So let’s start…

1 – Preparing the USB stick

You need an USB stick, about 1 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. Be aware that if you do all this, you’ll do it on your own risk!

The USB stick needs to be bootable, to achieve this I used PeToUSB. It can also install BartPE in one step, but I think it isn’t necessary to include the BartPE files if you don’t want to use it.

If you want BartPE on your stick this is the time, create the BartPE iso file. The following video (created by Runtime Software) shows you how to do that and how to include the DriveImage XML plugin:

Now insert your USB stick and start PeToUSB. Choose your USB stick as the destination and enable disk format. Point the program to your BartPE files if you want it installed (I mounted the BartPE iso file on a virtual drive) and enable file copy. Once you press start all data previously on the stick will be lost! Press start…

Now you have BartPE on your USB stick, and while it should be booting already by itself you can’t choose to boot anything else from that stick. That’s why a boot loader is needed, it enables you to chose which program to boot.

2 – Installing the boot loader

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

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!

Once you pressed install (it’s really quick) extract the contents of grub4dos 0.4.4 into a folder and copy only the files 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 (at least for my purposes), I started by shorting it to this:

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

title reboot
savedefault --wait=2
reboot

title halt
savedefault --wait=2
halt

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 – Installing Software: BartPE

BartPE is already on the stick, but it has to be included into the boot loader. Add this code to the menu.lst

6 – Installing Software: Parted Magic 3.5

Parted Magic is a Linux distribution that includes many programs and tools, most notably GParted for partitioning and formatting hard drives. Of course one could probably install GParted directly, but I didn’t get it to boot properly. Download pmagic-usb-3.5.zip and unpack the contents directly into the root of the USB stick. Now add this code to your menu.lst

After choosing Parted Magic from the boot loader menu it starts up and displays a splash screen, shortly after that I have to chose the parameters to enter the GUI. You might have to try the different options, the first one does crash on my system, the seconds works fine though.

7 – Installing Software: Ultimate Boot CD

Download the iso file, place it into the root of the USB stick and add this code to the menu.lst, make sure that the filenames correspond.

If you encrypt your system hard drive with TrueCrypt you need to create a Rescue Disk. You really need this CD – if the TrueCrypt boot loader or the master key get damaged you won’t be able to access your encrypted data any more unless you boot from the rescue CD. Usually I just create the iso file and keep it on a external hard disk. Placing it on a bootable stick is much more comfortable though, once you need it. I had to use it once already, do not underestimate the importance of this rescue disk.

Create the iso from TrueCrypt or use the one you already have. Place it into the root of the USB stick. Rename it to TrueCrypt.iso or modify the following code so that the filenames correspond. Add the following code to the menu.lst

9 – Installing Software: Acronis Rescue Media

This one is a little redundant for me since I already included Acronis into my BartPE version. Anyhow, create the Acronis Rescue Media iso file with Acronis True Image and place the iso in the root of the USB stick. Rename it to acronis.iso or modify the following code so that the filenames correspond. Add this code to the menu.lst

11 – Conclusion

I can not guarantee that this will work with any USB stick nor with every computer (it has to be able to boot from USB at least of course). To write this post I did every step again on a different USB stick though and it worked just fine. If you run into problems anyhow, I’m most likely not the one to ask for help. Other sources will certainly provide much better and detailed information, usually just not as simple.

One other thing: if your multiple boot USB stick works, create an image of it with DriveImage XML or any other imaging tool. This way you can recover it quickly if you accidently delete a file or have to format the stick after it had been in contact with an infected computer.

I hope this compilation does work as a tutorial and might be of help!

12 – Disclaimer

I don’t take responsibility for any damages of your system you might encounter following the actions described in this blog post. You do this on your own risk. Be aware that you might damage your running system easily (for example by manipulating the wrong boot record by accident).

Since I don’t use Windows any more as a primary operating system I did not update this any more and can’t answer questions. For further questions, additional tips and other stuff take a look at the comments, there are many people still contributing.

48 Responses to “Creating a multiple boot USB stick”

[…] And now for something completely different – a short tutorial on how to create an USB stick with all (well, at least a few) of the nice bootable rescue and recovery tools that exist today. It’s much more practical than …Read More […]

Great Post, Couple of issues.
1. I believe there is an error in the menu.lst. I am guessing that a program autocorrected your correct code to make it incorrect. for example. I am copying and pasting one entry.

before the words mem and hook i believe it should be two hyphens not – (as i am typing this i see it autocorrect (incorrectly) in the preview part below).
I believe that error is across the entire menu.lst infront of the words hook, set, mem and wait.

If you copy and paste that… it won’t work. The kernel line needs to be all in one line with the initrd following direct below.
After correcting that error i tried to boot to UBCD and failed.

I have not tried Acronis.iso or TrueCrypt.iso

Also… could you explain why the grub menu.lst is different for UBCD.iso, Acronis.iso and TrueCrypt.iso. I don’t understand why you need different grub commands if you are just loading an ISO file. I would think it would be the same… I tried to boot from a completely different ISO file and it failed.

Thanks for catching those single hyphens! It was indeed the auto-formatting done by WordPress that created those errors, it should be fixed now. I also fixed the broken line in the Parted Magic section.

Regarding your question on booting ISO files and the different codes I have to admit that I can’t help you there – as I said in the post, I don’t really know this stuff well enough, it’s just the way it works for me. Sorry.

Hello. That was the one most usefull tutorial I ever seen on web. Thank you very much. I want to know if there’s a way of putting Knoppix, Ubuntu, Win XP and VirtualBox in to that usb pendrive? I tried and failed about Ubuntu and Knoppix. I would really apriciate more if you could just let me know.. Thanks anyway..

In principle, adding full portable Operating Systems should only be limited by the Sticks size – it might require a little more knowledge though. I did try to include an Ubuntu iso but it didn’t work right away and I didn’t have any need to investigate that option further.

[…] keys, so I was looking for a way to condense them into one single USB with a GRUB menu. I found: http://florian.freundt.org/blog/?p=161 But, whenever I try booting into the ISO, it either pushes me to Busybox, or says the Media cannot […]

You getting error 62 with grub for reasons I could unfortuantly not figure out the cause. However, I was able to troubleshoot and found a solution. The error indicates that you need to add map a -heads=0 or similar aurgument, so before your map/path/to/iso.(hd32) try this:

map –heads=0 –sectors-per-track=0 /Clonezilla.iso (hd32)

I hope this helps you,as this made booting Ubuntu less problemaic for me.

Thanks for posting all of this information, you are partly responsible for Steve’s Ultimate Boot USB. I created Steve’s Ultimate Boot USB (SUBU) to meet my own personal bootable requirements and have now released it for everyone to use.

This is an excellent tutorial. I tried it the first time and it worked booting from my Sony 4gb flash drive. I have my Toshiba netbook Truecrypt-ed and wanted to be able to boot the rescue ISO in case the boot loader gets corrupted. I tested it and it worked fine. I’ve been to Boot-land.net for other resources but it is way over my head and some of the tutorials I’ve read are contradicting.

I am trying to add Norton Ghost’s System Recovery Disc iso to my multiboot usb stick via grub and thus far I can get it to boot the System Recovery Disc but it gives a “No Disk” error. Here is my grub menu entry, perhaps someone can figure it out.

Florian,
I finally managed to boot Clonezill from .iso file. You have to use the karmic or lucid variants.
The .iso file is located in /clonezilla folder under stick’s root, and the entry in menu.lst is:

How could i go about adding this so that I could place a folder on my USB drive with all the ISO’s in etc and then it looks for them there so that they are all in one place. I have the menu.lst on the root of the USB Drive and I have set the following but it keeps coming up with unrecognised command..? ie the folder containing all the ISO is the Multi Boot USB..?

First let me thank anyone who is willing to take the time to read and/or reply to this post.

I am having trouble with Hiren’s boot cd 12.0 in regards to booting it off a multiboot usb drive. I am able to load the boot.gz and everything works up until i actually try and run a program. For testing i have been trying to run MHDD hard drive diag tool. I get the error when i select MHDD from the hiren’s menu. What happens is hirens is looking for the MHDD.uha file in the RAM drive that it creates. So i end up getting the error !! file missing R:/HBCD/MHDD.uha !! Label not found.

Ive tried numerous ways of coding the menu.lst file that is in the root of the USB drive, as i was under the impression that the problem was with how grub4dos was loading the hirens files. But the more i think about the error, the more i feel this is a problem with the way hirens is coded, because it seems that the RAM drive is created by code from the hirens files. In order to clarify what ive done so far ill outline some steps below.

So thats basically it. I can boot off the USB drive and i get the first menu.lst interface. when i select hiren’s boot cd it loads to a “Hiren’s All in 1 BootCD 12.0 menu”. This hirens menu gives me the option to select “partition tools…., backup tools…., hard disk tools….”, etc. Ive been going to “hard disk tools…”. Then ive been trying “MHDD 4.6″.

When i select MHDD it immediately creates a 100mb ram drive as R: and extracts some unknown system files. Then it prompts to load mouse driver, other drivers, and keyboard layout. And then it tries to load mhdd.uha. This is where the error happens because its looking for the mhdd.uha file on the R: drive. This is where i need help.

Im not sure what files its extracting and copying to the R: drive. (i cannot find the exact files its extracting when i do a search of the usb drive)

Im not sure what code/file its using to create the RAM drive. (seems like hiren’s has its own menu.lst and custom-menu.lst files, neither of those have entries for the MHDD selection. So maybe its coded in the boot.img file?)

It would seem that the easiest thing to do would be to either edit the code its using to create the R: drive so that it points to the actual hirens folder on the usb drive where the MHDD.uha file is located. or to try and copy the program files its looking for into the files its extracting to the R: drive.

[…] I used this guide… didn't use all of it, mostly the stuff about making the USB bootable, and putting the Ultimate Boot ISO on it (although I dont use that ISO, the same process seems to work for other bootable ISOs) Yeah, I think its either OSX or Windows Slanted, but I use windows for my desktop at work. http://florian.freundt.org/blog/?p=161 […]