Wednesday, June 3, 2009

Boot Multiple Distro from USB / Flash drive / Pendrive

The below article is obsolete and out of date. Instead you should use multibootusb tool created by me. This is an open source tool and I have released the software under GPL3. Multibootusb has both windows and linux version. You will also find packages for debian/ubuntu, fedora, Opensuse, magea, mandriva and Archlinux. Here are the download links.
Windows :: http://sourceforge.net/projects/multibootusb/files/Windows/
Linux :: http://sourceforge.net/projects/multibootusb/files/Linux/
Project home page is here :: http://sourceforge.net/projects/multibootusb/

For any queries on multibootusb please contact me via feedback.multibootusb[at]gmail.com. I would be more than happy to help you.

You can proceed to obsolete article now...

As we all know best way to test new Linux distro is to boot from Live CD. But now a days new distros are coming out on the daily basis. So why you waste CD's? Better you can boot live distro from USB and it will be more fun if you have a multiple flavor of live distros in a USB. So in this post i will explain easiest way to create bootable USB with multiple Live distros, Troubleshooting and adding new distro which are not supported by the multicd.sh. By following this method i could boot 21 distros / Utilities from my Pendrive with lot of space to store data :-))

NOTE:: All the methods worked well for me but i can not give guaranty for anyone.

Creating and installing Multiple Distros in to USB / Pendrive

This involves two parts:-

1. Creating Multiple Live distro --->> Using Multicd.sh
2. Installing Multiple Live distro in to a USB / Pendrive --->> Using Unetbootin

Part I
For the first part you can follow up this post. At the end of it you will get multicd.iso file with your favorite distros.

Note:: If you write this multicd.iso in to a CD / DVD as an image file then you can directly boot from CD / DVD with multiple distros.

Part II
This part is quite simple and strait forward. If you do not know what is Unetbootin then click here to find. Download the window version of Unetbootin from same link as it is better supported. Remember that installation is not required for the windows version. I have not tested the Linux version but i think it should work.

Once the multicd.iso file is been created, reboot and login to windows. Insert Pendrive and wait for some time for windows to recognize it. Go to my computer to see the name of USB / Pendrive. In my case it is F:\. Now double click on the Unetbootin.exe file which you have downloaded from the above site. Unetbootin has three options Distribution, Disk Image and Custom. Click on the Disk Image option and navigate to the multicd.iso file which you have already created. Make sure that Type is set as USB Drive and Drive as recognized by windows. In my case it is F:\. Once again check everything and give OK. Unetbootin will take some time to install multicd.iso depending up on the size. After successful installation Unetbootin will ask you to reboot and go ahead. Now you have successfully installed multiple distro in USB and all set to access your favorite distro.

Upon reboot set your BIOS boot preference to USB. If you do not know how to set BIOS option then check this link to learn more. Once you set your BIOS option, system will boot from USB and you can see the list of distros you have already compiled using multicd.sh. Choose your favorite one to login. Remember that it is not a persistence installation so when ever you shutdown or reboot all data will be lost.

Problem and Troubleshooting

It is well and good if you can boot all the distros successfully. Trouble shooting is as easy as installing those distros. In some cases it may happen that you can see the list of distros after boot up from USB / Pendrive but may not be able to log in to distro. Note down which are the distros creating problem. For example Linuxmint and Knoppix are not booting. Login to Ubuntu and insert your pendrive / USB. Open pendrive and go to boot/isolinux and double click on isolinux.cfg (this is the file created by multicd.sh). Once you click on isolinux.cfg a new small window will prompt you with four options and click on Display. Now new text file will open with content like this (only entries for linuxmint and knoppix are given bellow). Note down the path for both kernel and append.


Now go to root folder (just open Pendrive), search for isolinux.cfg file (this is the file created by Unetbootin) and open it in the same fashion. Now find the entry of kernel and append for Linux mint and Knoppix. Ideally both the isolinux.cfg file entries should be same. If not then copy entry of linuxmint and knoppix from /boot/isolinux.cfg to /isolinux.cfg. Thats it. Boot from USB to login.

Adding distro which are not supported by the multicd.sh

In case if you want to add more distros which are not supported by the multicd.sh then follow up this method. When you download any distro it will be in iso format. Rightclick on it and select Extract here. Once extracted you can see the files and folders inside. Just copy and all and paste in to USB / Pendrive as it is (i mean do not change the directory structure). Note that some of the files and folders are not required like [BOOT] and isolinux (folder). Now search for the isolinux.cfg in the extracted folder and open it. Look at the entry for menu label, kernel and append. Copy those lines and paste in to /isolinux.cfg in the Pendrive. Save it and boot from USB. Now you can see those menu label entry in the boot up screen. Select the entry to go ahead.

Note:: Some of the distros use same directory structure with same name. In that case you can not install both. For example Linux mint and Ubuntu so choose your best distro.





3 comments:

  1. Nice article. It might be useful to you or others that you can achieve the same goal of copying your created multicd.sh iso to a usb thumb drive with the isohybrid tool (converts the iso so that it can be either burned to a cd OR copied to a USB stick) and dd or ddrescue. Very easy:
    # isohybrid multicd.iso
    # ddrescue multicd.iso /dev/sdX
    This worked for me (with a 3.6G image!), and is quicker and more painless than Unetbootin in my opinion!

    ReplyDelete
  2. Linux flash drive can provide a communication channel that is safe from a possibly compromised computer. linux flash drive

    ReplyDelete
  3. Brilliant post, nicely done. And thanks for mentioning all these information..usb-boot-drive

    ReplyDelete