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 having each tool on a CD, especially if you don’t have a CD drive as is the case with my Thinkpad X60s.

This is my rescue and recovery USB stick, it features

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.

Download PeToUSB

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…

(c)2009 by Florian Freundt

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.

Download grub4dos 0.4.4

Download grubinst 1.0.1

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!

(c)2009 by Florian Freundt

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:

(c)2009 by Florian Freundt

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

title BartPE
find --set-root /minint/SETUPLDR.BIN
chainloader /minint/SETUPLDR.BIN

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

title Parted Magic 3.5
kernel /pmagic/bzImage noapic root=/dev/ram0 init=/linuxrc keymap=us liveusb vga=791 sleep=0 quiet xvesa
tmpfs_size=350M ramdisk_size=25000 directory=/initrd /pmagic/initrd

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.

title UBCD 4.11
find --set-root /ubcd411.iso
map /ubcd411.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)

8 – Installing Software: TrueCrypt Rescue Disk (Updated on 2010-01-16)

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

title TrueCrypt Rescue Disk
map (hd0) (hd1) 
map (hd1) (hd0)
map --mem /TrueCrypt.iso (hd32)
map --hook
chainloader (hd32)

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

title Acronis True Image 2009
find --set-root /acronis.iso
map /acronis.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)

10 – Summary

By now, the USB stick should be bootable and all programs installed should be accessible from the boot loader (and work). The root of my USB stick looks like this:

(c)2009 by Florian Freundt

The complete menu.lst of this setup is

color black/cyan yellow/cyan
timeout 30
default /default
title MemTest86+
kernel /memtest.bin
title BartPE
find --set-root /minint/SETUPLDR.BIN
chainloader /minint/SETUPLDR.BIN
title Parted Magic 3.5
kernel /pmagic/bzImage noapic root=/dev/ram0 init=/linuxrc keymap=us liveusb vga=791 sleep=0 quiet xvesa
tmpfs_size=350M ramdisk_size=25000 directory=/
initrd /pmagic/initrd
title UBCD 4.11
find --set-root /ubcd411.iso
map /ubcd411.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
title TrueCrypt Rescue Disk
map --mem /TrueCrypt.iso (hd32)
map --hook
chainloader (hd32)
title Acronis True Image 2009
find --set-root /acronis.iso
map /acronis.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
title reboot
savedefault --wait=2
reboot
title halt
savedefault --wait=2
halt

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.

47 Responses to “Creating a multiple boot USB stick”

  1. [...] 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 [...]

  2. Andy Pryke says:

    Thanks Florian,
    this tutorial is clear and very helpful. By following steps 2 and 8 I managed to boot a TrueCrypt Rescue Disk from a USB stick, and I hope to use this method to boot any ISO from USB.

    Andy

  3. nika says:

    Great tutorial thanks

    now i can make any bootable CD to boot from my USB Stick

  4. UsuRpergoat says:

    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.

    =====
    title TrueCrypt Rescue Disk
    map –mem /TrueCrypt.iso (hd32)
    map –hook
    chainloader (hd32)
    =======

    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.

    Also in the Parted Magic section.

    =====
    title Parted Magic 3.5
    kernel /pmagic/bzImage noapic root=/dev/ram0 init=/linuxrc keymap=us liveusb vga=791 sleep=0 quiet xvesa

    tmpfs_size=350M ramdisk_size=25000 directory=/
    initrd /pmagic/initrd
    =====

    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.

    Failure reads for UBCD:
    ====
    Booting ‘UBCD 4.11′

    (hd0,0)

    Filesystem type is ntfs, partition type 0x7

    Autodetect number-of-heads failed. Use default value 255

    Autodetect sectors-per-track failed. Use default value 63

    floppies_orig=0, harddrives_orig=2, floppies_curr=0, harddrives_curr=33

    Warning: Unrecognized partition table for drive A0 Please rebuild it usig a MS-compatible FDISK tool (err=14). Current C/H/S=15/255/63 Filesystem type is iso9660, using whold disk

    Warning: Unrecognized partition table for drive A0 Please rebuild it usig a MS-compatible FDISK tool (err=14). Current C/H/S=15/255/63

    Warning: Unrecognized partition table for drive A0 Please rebuild it usig a MS-compatible FDISK tool (err=14). Current C/H/S=15/255/63 chainloader (hd32)

    Error 1: Filename must be either an absolute pathname of blocklist
    ===========

    So maybe i’m doing something wrong… or mabe Grub can’t read ISO’s or maybe the menu.lst is wrong… Help Please.. I would love to have any ISO in root and boot anything i would like.

    UsuRpergoat

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

  5. Roland says:

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

    rolanddes@gmail.com

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

  6. Alan says:

    Great tutorial.
    I’m having a problem booting into the TrueCrypt rescue disk.

    It’s boots fine, but then tells me my password is incorrect. The iso file is identical to the rescue CD which operates properly.

    Any ideas?

  7. mll says:

    Great tutorial indeed, thanks !

    FYI, I couldn’t get Parted Magic 3.5 to work, it shows 2 linux penguins, about 4 lines of code speaking of panic – see how clueless I am… :/ – and that’s about it.

    Neither does System Rescue CD‘s iso work properly (i used the settings you supplied for ubcd)

    On the other hand, I could get an iso image of UBCD to boot with the same parameters you provided.

  8. BluE says:

    @Alan: thats because the boot loader finds the usb stick as the first hdd and tries to encrypt it… got the same problem actually, trying to fix it..
    I found this: It might help you:
    http://forums.truecrypt.org/viewtopic.php?p=57113

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

  10. [...] I used: grub4dos-0.4.4-2009-06-20 grubinst-1.1-bin-w32-2008-01-01 And am following this guide: http://florian.freundt.org/blog/?p=161 Assistance would be much [...]

  11. @Erick says:

    Nice guide…is it possible to create a multi boot usb stick which contains all Operating System?

  12. Claude says:

    excellent article. I have been able to use it to create a TrueCrypt Rescue “Disk”.

    I am trying to extend it to run Clonezilla. I don’t really know what I am doing here, so I took the closest entry from the examples above in order to create the following entry in the menu:

    title Clonezilla
    find –set-root /Clonezilla.iso
    map /Clonezilla.iso (hd32)
    map –hook
    root (hd32)
    chainloader (hd32)

    (and copied Clonezilla.iso to the root folder)

    However I get the following error:

    Error 62: The number of heads must be specified. The “–Heads=0″ option tells map to choose a value (but may be unsiutable for you)

    Any ideas?

    Cheers,
    Claude

    • Daniel Jenkins says:

      Hello Claude:

      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.

      Daniel

  13. Sorry Claude, as I said in the article I don’t really know the stuff myself and since I switched to OSX I didn’t use this stuff any more.

  14. Steve Reeves says:

    Hey,

    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.

    please see hxxp://stevereeves.biz

    Thanks again for posting all of this info. on grub!

  15. Tero says:

    Very much thanks for helping to understand. My multiboot USB works now fine and I can add what I want. Thanks, Thanks! :)

  16. Ioupeka says:

    Hi all,

    here a link of automatized usb multiboot stick:
    http://www.pendrivelinux.com/boot-multiple-iso-from-usb-multiboot-usb/

  17. manicmyron says:

    Does any1 know the command to boot from hard disk to be writtern in menu.lst ???????

    thnks

  18. Mark says:

    Anybody knows how to add Partition Magic? Did anybody try that?

    Many thanks in advance ;)

    Mark

  19. Mark says:

    … Sorry, I forgot to type a HUGE THANKS to Florian for this amazing thread!!!

    Cheers,

    Mark

  20. Sebastian says:

    You saved my day :)

  21. Mike says:

    Hey Florian,

    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.

    Thanks again,
    Mike

  22. Keke says:

    (ad pt.2) How do i find out which hd (1,2 etc) my Usb-Stick is?

  23. Robert Pace says:

    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.

    title Norton Ghost 15 Recovery
    find –set-root /ngh15.iso
    map /ngh15.iso (hd32)
    map –hook
    root (hd32)
    chainloader (hd32)
    boot

  24. fms says:

    title Norton Ghost 15
    find –set-root /ngh15.iso
    map /ngh15.iso (0xff) || map –mem /ngh15.iso (0xff)
    map –hook
    chainloader (0xff)

    Try this code, works for me.

  25. fms says:

    Just remember wherever there is a single hyphen in the code, put two hyphens.

  26. Michael says:

    Brilliant, this has been a massive help.

  27. keopp says:

    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:

    title clonezilla-live-20100721-lucid
    find –set-root /clonezilla/clonezilla-live-20100721-lucid.iso
    map –heads=0 –sectors-per-track=0 /clonezilla/clonezilla-live-20100721-lucid.iso (0xff)
    map –hook
    root (0xff)
    loopback loop /clonezilla/clonezilla-live-20100721-lucid.iso
    kernel /live/vmlinuz boot=live union=aufs nolocales noprompt vga=758 ip=frommedia toram findiso=/clonezilla/clonezilla-live-20100721-lucid.iso
    initrd /live/initrd.img

    Thanks to the post here: http://www.linuxquestions.org/questions/linux-newbie-8/clonezilla-and-multiboot-iso-mount-usb-drive-787310/

  28. Peter says:

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

    title Windows & Linux Passwords
    find –set-root /Multi Boot USB/OphCrack.iso
    map –mem /Multi Boot USB/OphCrack.iso (hd32)
    map –hook
    root (hd32)
    chainloader (hd32)

    Any help would be greatly appreciated

  29. Peter says:

    all sorted, fat fingers small keyboard

  30. keopp says:

    try renaming the folder /Multi Boot USB into MultiBootUSB then use it in menu.lst.

  31. keopp says:

    a general advice: avoid empty spaces in file or folder or any names related with computers.

  32. Alexander R. says:

    Thank you so much. You saved my day. After a boot loader error my system didn’t come up again. But doing this quick steps saved me within 30 minutes from a lot of trouble.

    Once again. Thank you very much.

  33. Mitch says:

    Great Tutorial! Only thing I’m having trouble with is getting Parted Magic to work. I can’t find v. 3.5 anywhere, and the coding doesn’t work for v. 5.5. Any ideas?

  34. Niklas says:

    Great tutorial. I’m in love with my USB flash drive now and we are very happy <3 <3

  35. Anonymous says:

    All,

    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.

    i followed this tutorial for the basic steps. http://florian.freundt.org/blog/?p=161

    1: The usb stick is a 32 gig Imation formated to one FAT32 partition

    2: used PEtoUSB 3.0.0.8 to install a bartPE image

    3: installed Grub4dos 0.4.4

    4: copied to the root of the usb drive, grldr and menu.lst from grubinst 1.0.1

    5: copied to the root of the usb drive, the HBCD folder from hiren’s boot cd 12.0

    6: edited the menu.lst file in the root of usb to contain the following

    title Hiren’s boot cd
    find –set-root /HBCD/boot.gz
    map –mem /HBCD/boot.gz (fd0)
    map –hook
    chainloader (fd0)+1
    rootnoverify (fd0)
    map –floppies=1

    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.

    some example files it loads to the R: drive are:
    amsida.sys, attrib.com, drivers.uha, loadsys.exe, mem.exe, mode.com, oakcdrom.sys, pcmenu.bat, wbat.com, z.bat, etc.

  36. [...] 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 [...]

  37. Alex says:

    I had a hard time getting Parted Magic 6.1 to work – but after a few hours of research (and trial and error, though mostly research…), I made it work. This is the entire menu code:

    color black/cyan yellow/cyan
    timeout 10
    default /default

    title Parted Magic 6.1
    find –set-root /pmagic-6.1.iso
    map –heads=0 –sectors-per-track=0 /pmagic-6.1.iso (0xff)
    map –hook
    root (0xff)
    chainloader (0xff)

    title Acronis True Image 2011
    find –set-root /AcronisMedia.iso
    map /AcronisMedia.iso (hd32)
    map –hook
    root (hd32)
    chainloader (hd32)

    title reboot
    savedefault –wait=2
    reboot

    title halt
    savedefault –wait=2
    halt

  38. Anonymous says:

    xboot is better

  39. Zach says:

    Your truecrypt directions saved my ass. Big thank you!

  40. [...] Creating a multiple boot USB stick (includes instructions for TC Rescue Disc) [...]

Leave a Comment