Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hello everyone, How does one configure a live USB to be able to boot several different distos? For example, I have a 4 GB USB key and I want to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    5

    Boot several distros off USB


    Hello everyone,
    How does one configure a live USB to be able to boot several different distos? For example, I have a 4 GB USB key and I want to have the choice of booting between 7 diffferent linux distros on it at boot when it's mounted.

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    You can use Grub Legacy or isolinux to boot them. You can use Grub2 to boot the distriubtion as a iso file but you will need to create your own boot menu (grub.cfg file). More info on which distributions you are thinking about would be helpful. If they are Ubuntu or derivatives, it would probably be easier to do with Grub2 as it can boot iso files from a CD/DVD/flash drive.

    If you use Grub Legacy or isolinux to boot, what you would need to do is loop mount each iso file to a specified mount point (directory), create another directory (probably in your /home/user directory) and copy the mounted files to this directory where you will have write permissions. You would need to do this with each iso file and make sure that you do not have duplicate and necessary directories or files in subsequent iso files or they will be overwritten. For example, any Ubuntu derivative will have a casper directory in the root of the filesystem. You will need to create your own menu.lst file in the /boot/grub directory and install the stage2_eltorito file there.

    It would be easier to give more specific advice if you indicated which distributions you are interested in. You will probably not be able to get 7 full distros on a 4GB flash but if some are smaller it should be no problem.

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Posts
    5
    Ok the 6 distros are geeXboX, Puppy Linux (Slacko), Tails, Inquisitor, Clonezilla, and PartedMagic, so the 4 GB is fine. Already Puppy Linux is not Debian based so I guess I'd have to use isolinux or Grub Legacy? I'm not very experienced with this so I didn't quite understand what "loop mount" meant. Actually, I didn't really understand most of what you said :/

  4. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Example of loop mounting an iso name puppy.iso (the name you use in the command needs to be exactly what the file is named, it is case-sensitive also)
    First create a directory in your /home/username directory. If your user is martin you would do this in a terminal: mkdir /home/martin/iso
    That will create a directory named iso in /home/martin. When this is done, copy all of the iso files you want to loop mount to the /home/martin/iso directory
    Next in the /home/martin/iso directory, create two more directories named iso2 and usb using the mkdir command above(you can name them anything else you wish)
    Open a terminal and log in as root user and navigate to the /home/martin/iso directory. To loop mount an iso file named puppy.iso use this command:

    mount -o loop puppy.iso iso2/ (You should then be able to see the directories and files from puppy.iso.
    If you see the puppy.iso files in iso2, copy them to the usb directory you created earlier so that you will be able to write to them. Loop mounting an iso file will have all the files as read-only which is why you need to copy them to the other (usb) directory.
    Next step is to unmount the iso2 file: umount iso2/

    You then need to repeat the loop mount command for the next iso file to mount it in iso2 and then copy the files to the usb directory. If you have directories or files with the same name, the second one copied will overwrite the first. Most will be using isolinux to boot from the CD image so it would be a good idea to copy the contents of each systems isolinux.cfg file (or at least the first menu entry) to an empty text file which you can later use for the isolinux.cfg file when you have all of the systems copied. You will need to combine the men entries of isolinux.cfg for each system into a single file.

    Be sure to unmount iso2 after copying the files to usb and realize the command is NOT unmount, but umount!

    Try it and see how it goes and if you have problems, post back. Incidentally, you can use this method to boot distributions like Puppy with Grub2, you just cannot boot it by simply copying the iso file, it needs to be extracted as above (loop mount).

  5. #5
    Just Joined!
    Join Date
    Feb 2012
    Posts
    5
    Ok I did that with geexbox, android-x64 and puppy (I decided to simplify the list), but I get the "Missing operating system" message when booting. All 3 have different isolinux.cfg, isolinux.bin, and vesamenu.c32 files (puppy's vmlinuz is different from the other two I think). I just concatenated the 3 .cfg files together without modifying the contents, is that where the problem lies? Or are there other issues beside the menu? If so, couldn't I just create a menu or use some commands that allow one to choose between the distros' menus, and perhaps that way I could have each distro mounted in separate folders so they wouldn't have overwritting issues? Thanks a lot for the time, I'm learning quite a bit through doing this.

  6. #6
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    You should be able to put the isolinux directory contents of any of the distros in the usb directory you created. You should not need separate files for each and it should not make any difference which you use. Combining all the isolinux.cfg files should work, it will just be a big file.

    Putting each in a separate directory might be worth trying but, my experience has been that some distributions need certain files in the / (root of the filesystem) and will not work if the files are in a sub-directory and not /. If you have the vmlinuz and initrd files in the same location when you loop mount their distros you will likely have a problem when you copy them to the usb directory as the second will overwrite the first if they have the exact same name. And as I said, if they are not in the directory where they are when loop mounted, you probably won't be able to boot.

    I've actually only used unetbootin to create a multi-boot flash drive that uses syslinux.cfg as the boot menu file. I usually use Grub Legacy and have used Grub2 also. If you want to try using unetbootin, I am posting a link to a youtube video which explains that method. The big thing will be copying the syslinux.cfg entry for each distro to an outside file as each distro will overwrite the previous file. When you have finished, copy the syslinux.cfg file back.

    Multiboot USB drive How To - Linux - YouTube

    If you decide to do this, I would suggest you watch/listen to the video several times before starting.
    If you would rather try doing it with Grub, post back and I can explain how I did it.

  7. #7
    Just Joined!
    Join Date
    Feb 2012
    Posts
    5
    I can't watch the youtube tutorial because I'm in Beijing at the moment with no VPN (I'll be back in France the 24th) so I guess I can either wait or experiment. Is it more than just combining the syslinux.cfg files? (or is that the part why I need to watch the video?) I'll be glad to do it with either grub or unetbootin, as long as I can get it to work.
    Thanks a lot for the help.

  8. #8
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Is it more than just combining the syslinux.cfg files?
    Yes. Unetbootin installs syslinux to the usb so just copying the files there won't work, at least that is my understanding. I've never tried using syslinux except with unetbootin but have done this a number of times with Grub and Grub2. Since on of the distros you plan to use has Grub Legacy (Puppy) you might try that. After you have copied all the files to your usb directory, create a text file and name in menu.lst and put it in the /boot/grub directory of the usb directory. A sample entry for Puppy in menu.lst is below:

    title Puppy-Lupu-511
    kernel (hd0,0)/vmlinuz
    initrd (hd0,0)/initrd.gz
    You may need to change the (hd0,0) but that usually works for me when I set the BIOS to boot the flash drive as first boot priority. After creating your menu.lst, you will need to copy the stage2_eltorito file to the /boot/grub directory in the usb directory. It can be found in any Linux using Grub Legacy in either the /usr/lib/grub directory or the /lib/grub directory. To create Grub Legacy entries from an isolinux.cfg menu, you would take parameter options which on isolinux are usually on the initrd line and put them on the kernel line of the menu.lst file.

    Install Grub to the mbr of the flash drive. If you have the Linux iso on a CD, boot it and install its Grub to the mbr of the flash drive. The flash drive will probably be sdb but I don't know how many drives partitons you have. You can run the fdisk command to get the output as it gives the size of drives if you have a number and you will see what the 4GB is named. Assuming it is sdb, open a terminal in Puppy and run these commands, hit the enter key after each line:

    root (hd1,0)
    setup (hd1)
    quit

    Very important that you get the correct drive or it will totally mess your installed bootloader. Once you have done, this check the the /boot/grub/menu.lst file in the usb directory and review the entries before trying to boot. I'm doing a lot of this from memory as I haven't done it for a while and I usually did it with a CD/DVD which is different.

    Good luck and keep us posted.

  9. #9
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Don't know if you have resolved this but I found a puppy iso on my computer and downloaded geexbox and android. I used unetbootin to install puppy to the flash drive. After doing that, I created a puppy directory in the / of the flash and copied all the files for puppy to that directory. I copied its syslinux.cfg file to another directory. I then used unetbootin to install geexbox on the flash, copied the entries from its created syslinux.cfg file to the one I had moved after doing the puppy install. Repeated this process for android and then combined all the entries for each system in a syslinux.cfg file and moved it back to the / of sdb1.

    I then booted with the flash set to first boot priority and was able to boot geexbox and puppy but android just took me to a splash screen and froze. I'm not sure what the problem is as I was able to boot the android iso in VirtualBox with no problem?

  10. #10
    Just Joined!
    Join Date
    Feb 2012
    Posts
    5
    Got back from China yesterday and watched the video. Basically I followed all the instructions except that I didn't move any of the files in separate directories. I booted from USB and got the menu that I made, so that worked. Android and Puppy are working perfectly for me, however Geexbox is not working. I select the video mode and I get the splash, but then I'm told that the root file system can't be found and it sends me to the command line (Geexbox does work when I regularly install it on a usb). It's strange that geexbox doesn't work for me and android doesn't work for you...

    EDIT: Ok I redid the installation in a different order: android, puppy then geexbox. This time android and geexbox worked, but puppy didn't. As I don't put the files in separate folders, i assume that it's a problem with different kernels and such. I'll keep working at this.
    Last edited by MartinMPL; 08-25-2012 at 12:36 PM.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •