Skip navigation

aLive Multiboot USB


Outcome: To create a USB stick that contains multiple GNU/Linux (Linux) distributions using syslinux as the boot loader.

I love to play around with different Linux distributions; I find certain ones to be better suited at certain tasks, but having to switch between, and carry around, a key chain full of USB stick is not really practical, or something I can afford.
Thankfully, syslinux allows me to easily create a single, multi distribution USB stick, which is my little geeky life saver: whenever I’m asked to do a bit of repair work on a friends computer, I can bring along a single stick full of maintenance goodness; and also, if I’m away from home and don’t have my laptop with me, I can boot up my beloved, live version of Arch Linux customised with all my usual programs and files (see my ‘howto’ if you’re interested).

How To

I’m going to assume that you are sitting in front of an Arch Linux box to create the USB; however, these instructions will, well should, work no matter what operating system you are using (read: *nix); I will try to point out any OS specific points.
The process is quite simple. It basically amounts to: formatting the stick, installing syslinux and the MBR, copying the distribution over, and creating a configuration file.

First, install syslinux with your package manager to your OS. We are not installing syslinux to the disk, just grabbing the files so we have them to hand:

(root)#: pacman -S syslinux

The syslinux files will be installed to /usr/lib/syslinux; some distributions may install them to /lib/syslinux.

Next, plug in your USB stick. You’ll want to completely format it, and create at least one partition with FAT32, marked ‘bootable’, which is where the distros shall live (I’ve not had much luck with ext, yet).
If you create more than one partition, make sure that this FAT32 distro partition is the first.
On my 8GiB USB, I’ve created two partitions: the first being a 4GB FAT to hold the distros, and the second being an encrypted (Luks+Ext4)  partition where I can hold my private data.

I’ll assume you are aware on how to partition a disk using *nix tools such as fdisk and cfdisk.
If not, gparted and qtparted makes the process quite simple, but if you get stuck just leave a comment.

Once complete, mount the first partition of the USB and create a directory called “syslinux” at the root of it.

(root)#: mount /dev/sdX1 /mnt/
(root)#: mkdir /mnt/syslinux

Install syslinux to the first partition of the USB:

(root)#: syslinux -d syslinux -i /dev/sdbX1

Now install the MBR (Master Boot Record) to the USB itself (not the partition. ie. don’t add a number after sdX).
The MBR file we need is located in the same place where syslinux was installed earlier (/usr/lib/syslinux/mbr.bin):

(root)#: dd conv=notrunc bs=440 count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sdX

That takes care of syslinux, well for the most part. Now you want to copy over the Linux distributions you want.
I’ll assume you’ve downloaded some Linux ISOs.
Once you have, you’ll want to mount the ISO somewhere so you can get to it’s files. I’ll assume here that distro.iso is the distribution you’ve downloaded, and /media will be the mount point.

(root)#: mount -t iso9660 -o loop,ro distro.iso /media

If you take a look in /media, you’ll see the contents of the ISO file. Now here is where it starts to get a little tricky.
Each distribution will have their own way of laying out the files. Normally you will have a folder which contains OS files (such as the kernel, initrd, and the filesystem(s) in a squashfs format), and a folder which contains all the syslinux/isolinux related files.

Create a new directory at the root of your USB with a brief name of the OS your are going to copy over, for example for BackTrack:

(root)#: mkdir /mnt/backtrack

Now copy over everything from mounted ISO file, to this newly created folder.
If there is a syslinux or isolinux folder at the root of the mounted ISO you can ignore copying that over, but if you are unsure just copy  everything, so, again using BackTrack as an example:

(root)#: cp -r /media/* /mnt/backtrack

Do this process for all the distributions: creating a new directory at the root of the USB, mount the ISO, and copy the files over.

All that is required now is to create a syslinux.cfg file which is the configuration file for the menu you see when you boot the USB.
You can either have a basic command line based boot loader (probably not what you want), or a pretty GUI so you can easily select the distribution to boot.

In order to have a GUI menu, you need to copy the vesamenu.c32 from the syslinux installation path, to the syslinux folder on the USB (/mnt):

(root)#: cp /usr/lib/syslinux/vesamenu.c32  /mnt/syslinux

For the syslinux.cfg, you can use this one obtained from the Arch Linux Wiki.
Save this to the syslinux directory on the USB.

What you need to do is copy the relevant syslinux entries from all ISOs, paste it into the syslinux.cfg you’ve just placed on the USB, and modify the paths slightly.

For some distributions, this is a straight forward process, for others, if they use complex syslinux menus, it can require a bit of searching and thought.

When you mount the ISO, have a look for a syslinux/isolinux directory. It can sometimes be located within a boot folder, or sometimes, as in the case of BackTrack, at the root.
Once you’ve found it, you’ll then want to look for the relevant file which has the menu entries.
Again, for some distributions, such as BackTrack, the syslinux.cfg will be what you are looking for; others maybe using isolinux so you’ll have to look for an isolinux.cfg file; for others, there may be many files and it may be unclear as to which ones contain the menu entries.
You will need to go through all the *.cfg files and look for the entries that is responsible booting the system, and contain references to the kernel (normally called vmlinuz), and the inital RAM disk (normally called initrd).

For BackTrack, the syslinux.cfg has multiple entries for booting into different modes (normal, fallback, stealth, etc).
Copy one, or all if you want them, of the entries to the the syslinux.cfg file on your USB (/mnt/usb/syslinux.cfg).
As we have created multiple directories on the USB to hold each distribution, you’ll want to modify the paths to the lines calling the kernel, initrd (and any thing else it expects) to fit in with our layout.
This will normally just amount to appending a forward slash ‘/ along with the name of the directory you created to the beginning of the kernel and initrd paths.

For example. With BackTrack, this is one of the entries from the original syslinux.cfg that came from the mounted ISO:

menu label BackTrack Text – Default Boot Text Mode
kernel /casper/vmlinuz
append  file=/cdrom/preseed/custom.seed boot=casper initrd=/casper/initrd.gz text splash vga=791–

As all the files for BackTrack are now stored within the new folder (‘backtrack), all references to the files it needs has to be changed.
Here’s the working, modified version:

menu label BackTrack Text – Default Boot Text Mode
kernel /backtrack/casper/vmlinuz
append live-media-path=/backtrack/casper boot=casper initrd=/backtrack/casper/initrdf.gz text splash vga=791–

Note here that I’ve added an extra line (“live-media-path”), you will not need to add this most distribution; BackTrack (and some other Debian based ones) are a little picky in the way they boot, and that is just a quick fix.
Do the same process for each distribution: mount the ISO, find the syslinux entries, and copy them to your syslinux.cfg.

That should be it. Reboot your machine with the USB stick in, make sure your BIOS is set to boot from it, and all should work.

If not, feel free to post a comment and I’ll give you a hand.

Tips welcome: :)
BTC: 122tLuUjCE945nLbcSwM2ZtKXxpYgWAfke
LTC: LVkMvyn8qdnjqxci65gkjUf6LJhAeumq29

About these ads


  1. Hey thanks so much for the How To… I just need help with the last section… This is what I have so far

    KERNEL TEST123/file.bss

    When I try to boot the file.bss it start loading the files but it can’t find them because is looking for the files inside the root of the usb but all the files are inside another folder (test123) how can I tell the file.bss to look/load the file from that particular folder? is more than 1 file that it need to load

    • Hey, you need to add a forward slash / to the beginning of the path, so:
      TEST123/file.bss will become /TEST123/file.bss.

      If you leave off the forward slash, syslinux will look for the files within the current directory (which will be where syslinux is located); the forward slash tells it to look at the root of the USB.

  2. This looks like a nice guide – I have been having a problem trying to make a bootable usbkey to run a firmware update for Crucial mSATA SSD from the page at (select mSATA SSD from the pulldown list) – I have been trying to make a bootable key from the downloaded iso using several different methods including running unetbootin – but nothing I have tried gets booted on my machine (an Intel DQ77KB motherboard) – though a bootable Parted Magic iso made into a usbkey using unetbootin works fine! So I presume there is something oddball about the firmware update iso – which has memdisk and a floppy image as a .img file in it.

    I have been tearing my hair out trying to get it to work but maybe your method might lead to a usbkey that will boot on my system!

    Thanks for any advice.

  3. I ran through the technique you described – (from my arch linux laptop) – but I either did the specifications wrong in my syslinux.cfg or maybe put the paths wrong to link into the directory where the copy of the files from the iso went – either way it fails to do anything at all when I boot the key! Yes on the same machine the archiso usbkey written with dd boots just fine! So I will await any useful hints and tips!

    • After a bit of trail and error I’ve managed to get the firmware update to boot, here’s how:
      -Assuming a freshly formatted USB stick with one partition using FAT32 **marked as bootable**:

      1) Mount the USB and the ISO image some where (I’ll assume /mnt/usb and /mnt/iso)

      2) Follow the first three commands above to create the syslinux directory, install it, and install the MBR

      3) Create the folder “crucial” on the root of the USB.

      4) Now copy everything from within the isolinux directory in the ISO to BOTH the “crucial” and “syslinux” directory on the USB, (you may only need to copy the boot2880.img & memdisk files to the “crucial” folder, but I haven’t tested this, just copy everything to both locations to be safe). So:
      —cp /mnt/iso/boot/isolinux/* /mnt/usb/crucial/
      —cp /mnt/iso/boot/isolinux/* /mnt/usb/syslinux/

      5) Within /mnt/usb/syslinux, move (rename) the “isolinux.cfg” file to “syslinux.cfg”
      –This could be where you had a mishap. Some images will use a variant of SYSLINUX called ISOLINUX.
      They are essentially the same thing, but the differ in where they store the boot information.

      6) Now edit the syslinux.cfg (/mnt/usb/syslinux/syslinux.cfg) file, and append “/crucial/” to the initrd path.
      –The file should now look like this;

      Hope that helps, it booted find on my system, just don’t forget to make the partition bootable.
      If you need any more help just let me know.

  4. Thanks for the additional hints – I will try it in a few days – I have had to build a new system as a relative’s computer had a hard disk failure yesterday so it will take a few days to sort that out.

    One additional thing that I discovered that may be an issue for me is that I have learned that some bioses don’t see the usb key during boot as in the same mode as on other machines! There are apparently 4 different modes – usb-hdd, usb-fdd, usb-zip and usb-cdrom. I have only just discovered this and I don’t know much about it – but apparently this can lead to a usbkey which boots perfectly well on one machine not booting at all on another where the bios is buggy! Anyway once I can get back to this I will try your method and see if I can glean any more information about these strange usb connection modes. I have seen some methods for making sure that the largest number of bioses will see the drive as usb-hdd and boot it but I have not had time to look into that.

    • Ouch. You should give SpinRite a try (; it’s extremely good at recovering from even the worst hard disk failures to recover data and get the system bootable. It’s not free, but you can find it on some torrent sites to see if it works before you buy.

      I’ve noticed the same thing on some BiOSes (as with my own), and it’s never been an issue; the USB flash drive is recognised and boots as a USB-HDD.
      I’ve only had the issue of one of my flash drives not booting on a BIOS like this and that was a fairly modern PC.

  5. Actually the system that broke was an old Fedora system and the new system is Arch Linux – so the only files from the old system were some user files that were kept on backup, and a few config files which were also in backup. So nothing needs retrieving from the old machine – though I have had a total disk failure before where, just like this occasion, the disk problem prevents the system firing up at all until the old disk is removed and a new fresh HD put in to replace it! So it is just a question of time building the new system and then copying back the user files that are needed into the user area concerned.

    Hard drives sometimes last up to 10 years but others only 2 or 3 years. I guess that in the past decade I have had 3 or 4 occasions where the HD has totally failed – always 7200rpm drives and different Brands. So it is pot luck as to how long drives seem to last! Having regular backups is the only really safe way to work!

    I will get back to the SSD boot issues within the next week or so I hope.

  6. After spending some time away to build the new system I mentioned I finally had some time to revisit the bootable key issue – it turns out that in the interim since I was last working on this Intel has released a BIOS update to my motherboard. Tonight when I checked the Intel website tonight for BIOS updates it turns out that, between when I built the machine and today, Intel released a BIOS update that fixed a whole tranche of bugs including ” Updated VBIOS to fix issue where there is no display in DOS.”

    So I downloaded the BIOS update file – and updated the motherboard BIOS. Then I put the Crucial SSD firmware update file onto a bootable usbkey – and booted the system, selecting the usbkey for the boot – it DID boot perfectly well into the Crucial SSD firmware update just fine – so both my SSDs now have the current latest firmware….. so all the problems I had failing to update the SSD drives was due to a BIOS bug that is now fixed! So now I will not be subject to the infamous 9000 hour SSD failure!

    I think that your method for making the key is just fine – and so are alternative methods – but whatever I did would have failed until I updated the motherboard BIOS since the SSD update firmware runs DOS!

    Thanks for your replies previously.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: