Creating a pen drive bootable with multiple Operating Systems in Ubuntu

Posted: May 16, 2011 in Ubuntu
Tags: , ,

Hello folks.

You are working in your computer and suddenly your system freeze and you restart it but it doesn’t load anymore. So, you will need a bootable CD. However, you don’t want to use Ubuntu instead you want to use Kubuntu or Linux Mint. You will need a CD for each one. In this case, what about put all them in one place? Then, let’s do that.

Plug a pen drive in your computer and then we need to find out the mount point. Open a terminal and run:

mount | grep /media

You will have a answer like that:

/dev/sdb1 on /media/INDUS type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077, utf8=1,showexec,flush)

My mount point is in /dev/sdb1. Next step, we will clean the pen drive. All data will be removed. So make a backup before continue. I will do reference to my mount point and don’t forget to change it to yours.

Still in the terminal, run the commands below to remove all data and create a folder where all ISO files will be stored.

sudo umount /dev/sdb1
sudo mkfs.vfat -F 32 -n PenBoot /dev/sdb1
sudo mount /dev/sdb1 /mnt
sudo mkdir /mnt/ISO

All data cleaned, let’s install the Grub2 into pen drive:

sudo grub-install --force --root-directory=/mnt /dev/sdb

After that, create a file called grub.cfg in /mnt/boot/grub/ and type:

set timeout=15
set default=0

menuentry "Ubuntu 11.04 Desktop 64 bits" {
set iso="/ISO/ubuntu-11.04-desktop-amd64.iso"
loopback loop $iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}

menuentry "Kubuntu 11.04 Desktop 32 bits" {
set iso="/ISO/kubuntu-11.04-desktop-i386.iso"
loopback loop $iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}

menuentry "Linux Mint 10" {
set iso="/ISO/linuxmint-10-gnome-dvd-amd64.iso"
loopback loop $iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}

menuentry "Slax 6.1.2" {
linux /slax-boot/boot/vmlinuz
initrd /slax-boot/boot/initrd.gz ramdisk_size=16384 rw root=/dev/ram0 autoexec=xconf changes=/slax
}

If you want to download the ISOs above, click on the link below to access the respective site.

  • Ubuntu 11.04 Desktop 64 bits: www.ubuntu.com
  • Kubuntu 11.04 Desktop 32 bits: www.kubuntu.org
  • Linux Mint 10 64 bits: www.linuxmint.com
  • Slax 6.1.2: www.slax.org
  • With exception slax-6.1.2.iso, copy all ISO files downloaded to the folder /mnt/ISO. For Slax, we need to make some settings different. With the terminal opened, go to the folder where is slax-6.1.2.iso and run:

    mkdir /tmp/slax-6.1.2
    sudo mkdir /mnt/slax-boot
    sudo mount -o loop slax-6.1.2.iso /tmp/slax-6.1.2
    cd /tmp/slax-6.1.2
    sudo cp -R boot /mnt/slax-boot
    sudo cp -R slax /mnt
    cd
    sudo umount /tmp/slax-6.1.2
    sudo umount /mnt

    The commands above separates the directories slax and boot because Slax has a specific settings in the boot. That's the reason we cannot put the directory /slax-boot/boot in /boot and regarding the directory slax, Slax searches by it in root directory during boot. About mounting ISO file, we can get more information in Mounting a ISO image in Linux.

    To test your pen drive with multiple ISO, restart your system and don't forget to set the boot order in the BIOS to boot firstly in USB.

    Here I opted to use these operating systems. However, you can remove or add others systems.

    That's it. See you next time.

    Advertisements

    Leave a Reply

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

    WordPress.com Logo

    You are commenting using your WordPress.com 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