How to create a multiboot USB drive using syslinux

syslinux




syslinuxA multiboot USB drive with many Linux distribution it’ very useful for demo, installation or utility.

There are several tools to create it, but, in this post, I want to explain how to create a multiboot USB drive using syslinux.

For example we can create it with the following Linux distributions using syslinux on a PC with Ubuntu 14.04:

  • Ubuntu desktop 14.04
  • Xubuntu 14.04
  • Ubuntu Mate 15.04
  • Edubuntu 14.04 64bit
  • Edubuntu 14.04 32bit
  • Elementary OS Freya
  • Kodibuntu 14.04
  • System Rescue CD 64 bit
  • System Rescue CD 32 bit
  • Zorin Educational 64 bit
  • Linux Mint 64bit Cinnamon

insert the pen drive in a USB port, then open the Terminal and give this command to understand which is the device:

fdisk -l

Supposing that the device is /dev/sdc1, we can prepare it to become a multiboot USB drive:

sudo su
umount /dev/sdc1                        # unmount of the device
mkfs.vfat -F 32 -n MULTIBOOT /dev/sdc1  # format with file system vfat
syslinux -maf /dev/sdc1                 # installation of syslinux and MBR
mkdir /media/mb                         # create point of mount
mount /dev/sdc1 /media/mb               # mount of the USB drive
mkdir /media/mb/syslinux                # create the directory for the syslinux configuration
cp /usr/lib/syslinux/{vesamenu.c32,reboot.c32,poweroff.com} /media/mb/syslinux  # copy same file necessary
mkdir /media/mb/syslinux/iso           # creation of the directory where to store every Linux distribution we want

Now we have to extract the ISO image of the Linux distributions and copy those on the USB drive:

create the mount point where mount the ISO images

mkdir /media/iso

For all Linux distributions we have to execute the following commands:

mkdir /media/mb/syslinux/iso/ubuntu_1404
mount -t iso9660 -o loop,ro /media/paolo/hd2Win/ISO/ubuntu-14.04.2-desktop-amd64.iso /media/iso
cp -r /media/iso/* /media/mb/syslinux/iso/ubuntu_1404/
umount /media/iso/

obviously changing the name of the directory (ubuntu_1404) and the path where to find the ISO image in the mount command.

Then we remove the mount point created before

rmdir /media/iso/

and finally we create the configurazion file /media/mb/syslinux/syslinux.cfg with the menu that will appear when we boot from the pen drive:

DEFAULT Ubuntu_1404
PROMPT 0
allowoptions 0
TIMEOUT 100
UI vesamenu.c32
MENU TITLE USB Multiboot Key
MENU BACKGROUND splash02.png
MENU COLOR border 30;44 #40ffffff #a0000000 std
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
MENU COLOR help 37;40 #c0ffffff #a0000000 std
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
MENU WIDTH 80
MENU MARGIN 10
MENU ROWS 15        # number of rows in the menu
MENU TABMSGROW 18
MENU CMDLINEROW 18
MENU ENDROW -1
MENU PASSWORDROW 11
MENU TIMEOUTROW 20
MENU HELPMSGROW 22
MENU HELPMSGENDROW -1
MENU HIDDENROW -2
MENU HSHIFT 0
MENU VSHIFT 4   # vertical position of the menu

LABEL Ubuntu_1404
MENU LABEL Ubuntu 14.04 Trusty Thar
kernel /syslinux/iso/ubuntu_1404/casper/vmlinuz.efi
append initrd=/syslinux/iso/ubuntu_1404/casper/initrd.lz live-media-path=/syslinux/iso/ubuntu_1404/casper boot=live console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Xubuntu_1404
MENU LABEL Xubuntu 14.04
kernel /syslinux/iso/xubuntu_1404/casper/vmlinuz.efi
append initrd=/syslinux/iso/xubuntu_1404/casper/initrd.lz live-media-path=/syslinux/iso/xubuntu_1404/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Ubuntu_1504_mate
MENU LABEL Ubuntu Mate 15.04
kernel /syslinux/iso/ubuntu_1504_mate/casper/vmlinuz.efi
append initrd=/syslinux/iso/ubuntu_1504_mate/casper/initrd.lz live-media-path=/syslinux/iso/ubuntu_1504_mate/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Edubuntu_1404_64
MENU LABEL Edubuntu 14.04 64 bit
kernel /syslinux/iso/edubuntu_1404_64/casper/vmlinuz.efi
append initrd=/syslinux/iso/edubuntu_1404_64/casper/initrd.lz live-media-path=/syslinux/iso/edubuntu_1404_64/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Edubuntu_1404_32
MENU LABEL Edubuntu 14.04 32 bit
kernel /syslinux/iso/edubuntu_1404_32/casper/vmlinuz
append initrd=/syslinux/iso/edubuntu_1404_32/casper/initrd.lz live-media-path=/syslinux/iso/edubuntu_1404_32/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Elementary_OS_Freya
MENU LABEL Elementary OS Freya
kernel /syslinux/iso/eos_freya/casper/vmlinuz
append initrd=/syslinux/iso/eos_freya/casper/initrd.lz live-media-path=/syslinux/iso/eos_freya/casper LABEL Ubuntu_1404
MENU LABEL Ubuntu 14.04 Trusty Thar
kernel /syslinux/iso/ubuntu_1404/casper/vmlinuz.efi
append initrd=/syslinux/iso/ubuntu_1404/casper/initrd.lz live-media-path=/syslinux/iso/ubuntu_1404/casper boot=live console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Xubuntu_1404
MENU LABEL Xubuntu 14.04
kernel /syslinux/iso/xubuntu_1404/casper/vmlinuz.efi
append initrd=/syslinux/iso/xubuntu_1404/casper/initrd.lz live-media-path=/syslinux/iso/xubuntu_1404/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Ubuntu_1504_mate
MENU LABEL Ubuntu Mate 15.04
kernel /syslinux/iso/ubuntu_1504_mate/casper/vmlinuz.efi
append initrd=/syslinux/iso/ubuntu_1504_mate/casper/initrd.lz live-media-path=/syslinux/iso/ubuntu_1504_mate/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Edubuntu_1404_64
MENU LABEL Edubuntu 14.04 64 bit
kernel /syslinux/iso/edubuntu_1404_64/casper/vmlinuz.efi
append initrd=/syslinux/iso/edubuntu_1404_64/casper/initrd.lz live-media-path=/syslinux/iso/edubuntu_1404_64/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Edubuntu_1404_32
MENU LABEL Edubuntu 14.04 32 bit
kernel /syslinux/iso/edubuntu_1404_32/casper/vmlinuz
append initrd=/syslinux/iso/edubuntu_1404_32/casper/initrd.lz live-media-path=/syslinux/iso/edubuntu_1404_32/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Elementary_OS_Freya
MENU LABEL Elementary OS Freya
kernel /syslinux/iso/eos_freya/casper/vmlinuz
append initrd=/syslinux/iso/eos_freya/casper/initrd.lz live-media-path=/syslinux/iso/eos_freya/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL Kodibuntu_14_04
MENU LABEL Kodibuntu 14.04 64 bit
kernel /syslinux/iso/kodibuntu_1404/casper/vmlinuz
append initrd=/syslinux/iso/kodibuntu_1404/casper/initrd.lz live-media-path=/syslinux/iso/kodibuntu_1404/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

LABEL System_Rescue_CD_64
MENU LABEL System Rescue CD 4.5.4 64 bit
kernel /syslinux/iso/srcd/isolinux/rescue64
append initrd=/syslinux/iso/srcd/isolinux/initram.igz subdir=/syslinux/iso/srcd dostartx setkmap=it

LABEL System_Rescue_CD_32
MENU LABEL System Rescue CD 4.5.4 32 bit
kernel /syslinux/iso/srcd/isolinux/rescue32
append initrd=/syslinux/iso/srcd/isolinux/initram.igz subdir=/syslinux/iso/srcd dostartx setkmap=it

LABEL Zorin
MENU LABEL Zorin Educational 9 64 bit
kernel /syslinux/iso/zorin/casper/vmlinuz.efi
append initrd=/syslinux/iso/zorin/casper/initrd.lz live-media-path=/syslinux/iso/zorin/casper ignore_uuid boot=casper quiet splash --

LABEL LinuxMint
MENU LABEL Linux Mint Cinnamon 17.2 64 bit
kernel /syslinux/iso/mint/casper/vmlinuz
append initrd=/syslinux/iso/mint/casper/initrd.lz live-media-path=/syslinux/iso/mint/casper console-setup/layoutcode=it ignore_uuid boot=casper quiet splash --

MENU SEPARATOR

LABEL Reboot
MENU LABEL Reboot
COM32 reboot.c32

LABEL Power Off
MENU LABEL Power Off
COMBOOT poweroff.com

The multiboot USB drive is ready, so, we execute the last commands to unmount it and remove the mount point:

umount /media/mb                # smonto la chiavetta
rmdir /media/mb                 # elimino il punto di mount precedentemente creato

The result should be similar to this:

syslinux multiboot

Let’s try it now … and have fun 😀




Comments

Leave a Reply

Your email address will not be published. Required fields are marked *