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.
This is my rescue and recovery USB stick, it features
BartPE – BartPE is sort of a reduced, bootable WinXP version that can be created from your original Windows XP CD. I use it to access DriveImage XML backups, plugins for other software can be incorporated as well.
Acronis Rescue Media – Restoring the Computer from Acronis True Image 2009 backups or images.
Parted Magic 3.5 – Partitioning hard disks using GParted.
TrueCrypt Rescue Disk – Recovery of broken TrueCrypt boot loader or master key.
MemTest86+ – Testing the RAM for errors. A good way to narrow down error sources if your computer tends to crash a lot.
Ultimate Boot CD – A collection of various tools, actually I never used a single one yet, but I keep in on there just in case.
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 /defaulttitle reboot savedefault --wait=2 reboottitle 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 xvesatmpfs_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:
The complete menu.lst of this setup is
color black/cyan yellow/cyan timeout 30 default /defaulttitle MemTest86+ kernel /memtest.bintitle BartPE find --set-root /minint/SETUPLDR.BIN chainloader /minint/SETUPLDR.BINtitle Parted Magic 3.5 kernel /pmagic/bzImage noapic root=/dev/ram0 init=/linuxrc keymap=us liveusb vga=791 sleep=0 quiet xvesatmpfs_size=350M ramdisk_size=25000 directory=/ initrd /pmagic/initrdtitle 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 reboottitle 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.