12. September 2014 · Comments Off on Multi-boot UFD with Hi-Res Menus using Windows and Syslinux 6.xx · Categories: Batch Files, Graphics, Multiboot USB · Tags: Boot Loaders
Last updated on 11/13/2023

screenshot of main menuThis guide provides everything needed to create a customizable multi-boot USB flash drive in Windows with high resolution menus and customized splash screens. It provides a framework for creating a basic but functional multi-boot flash drive using Syslinux 6.xx as the primary bootloader. Basic menu configuration files and splash screen examples are provided. Experienced users shouldn’t find it difficult to follow this guide to create a ready-to-use bootable flash drive that can be customized to their needs. Users should already have some familiarity with Syslinux, installing Linux distros, and with formatting and partitioning flash drives.

For the sake of simplicity, this guide is limited to setting up Syslinux for a single partition using the BIOS modules. The instructions were tested and verified on a system running Windows XP SP3 and using Syslinux 6.02.screenshot of menu3 This guide is essentially a more up-to-date version and combination of two previous posts, Create a Multiboot Multipartition USB with Syslinux and Grub4Dos and Create Custom Grub4Dos, GRUB and Syslinux Compatible Splash Images.

Syslinux 6.xx

Syslinux provides two menu systems, the Simple Menu System and the Advanced Menu System. The advanced system must be compiled while the simple system includes the ready-to-use vesamenu.c32 and menu.c32 modules. This guide uses the vesamenu.c32 module.

Splash Screen Resolutions

Syslinux 6.xx can use splash screens in the .png or jpg formats at resolutions from 640×480 up to whatever is supported by the system. If the flash drive is going to be used on multiple systems, it would be best to use a typical resolution such as 800×600 that would work across most systems.

Modules

Since version 5.xx, modules are no longer stand alone or need additional libraries to work. A description of the changes can be found on the Syslinux Wiki at https://www.syslinux.org/wiki/index.php/Library_modules. In most cases, Syslinux will alert you of any additional libraries required when you try to use them.

(U)EFI (Unified/Extensible Firmware Interface)

Although there has been a lot of hype about (U)EFI (Unified/Extensible Firmware Interface) in general and support for (U)EFI began with Syslinux 6.xx, the (U)EFI modules are still fairly new, have a number of unresolved issues, and are not widely used at this time. UEFI in Syslinux is buggy and has problems on both Windows and Linux. Arch Linux describes some of the more relevant ones at https://wiki.archlinux.org/index.php/syslinux#Limitations_of_UEFI_Syslinux. Some of the issues with UEFI are:

  • UEFI Syslinux does not support chainloading other EFI applications like UEFI Shell or Windows Boot Manager.
  • UEFI Syslinux does not boot in Virtual Machines like QEMU/OVMF or VirtualBox or VMware and in some UEFI emulation environments like DUET.
  • Memdisk is not available for UEFI.
  • UEFI Syslinux application syslinux.efi cannot be signed by sbsign (from sbsigntool) for UEFI Secure Boot.
  • Using TAB to edit kernel parameters in UEFI Syslinux menu leads to garbaged display (text on top of one-another).

Other Syslinux issues/limitations:

  • Using Syslinux 6.02 on BTRFS volumes corrupts the superblock.
  • Syslinux cannot access files from partitions other than its own.
  • Using the memdisk module to boot most ISOs is often difficult or impossible.

Syslinux.org has admitted to these limitations and has often recommended other bootloaders such as GRUB, Grub4Dos, or Plop Boot Manager to compliment Syslinux. In spite of this, Syslinux remains one of the most functional and popular bootloaders not only for flash drives, but for other bootable devices like CDs, for most operating systems, and for chainloading partitions and hard drives. It’s very flexible and is an excellent choice as the primary bootloader for most situations. And by adding another bootloader such as Grub4Dos, this greatly enhances the flash drive’s booting options.

Creating a Multi-boot Flash Drive steps:

  1. Format the flash drive
  2. Install Syslinux 6.xx
  3. Install modules and files
  4. Install or create splash screens
  5. Customize menu configuration files (optional)

1. Format the Flash Drive

Format the flash drive with FAT16 or FAT32.

2.  Install Syslinux 6.xx

Download and unzip the latest .zip version of Syslinux 6.xx from Kernel.org. The file size should be about 12mB before unzipping. Open a cmd window and cd to C:\syslinux-6.xx\bios\win32. Type the following to install Syslinux to the flash drive where x is your flash drive:

syslinux.exe -sfma x:

This installs ldlinux.c32 and ldlinux.sys to the flash drive.

3. Install Modules and Files

Modules

Look for and copy the BIOS versions of the modules shown in the directory tree for the root of the flash drive. An easy way to locate the modules is to use something like AgentRansack. Modules have a .c32 extension (except memdisk) and are located in various folders in the C:\syslinux-6.xx\bios\com32 directory or C:\syslinux-6.xx\bios directory (for memdisk). Place all of the modules in the root directory of your flash drive. Copy the following modules:

chain.c32
cmd.c32
cpuidtest.c32
hdt.c32
ldlinux.c32
libcom32.c32
libgpl.c32
libmenu.c32
libutil.c32
meminfo.c32
menu.c32
memdisk
poweroff.c32
pwd.c32
reboot.c32
vesainfo.c32
vesamenu.c32

Configuration Files

The help text, menu.cfg, syslinux.cfg and other configuration files required can be downloaded from the configfiles download link below. Right click and using “save target link as” or similar (depending on your browser) to download it and then unzip and extract its files to the root of the flash drive.

  configfiles (9.8 KiB, 1,179 hits)

Download the latest version of Grub4Dos from grub4dos-chenall. Extract the grub.exe and menu.lst files to the root of the flash drive.

4. Install or Create Splash Screens

Install ready-made Splash Screens

To get started, splash screens tested to work with the configuration files are provided below. Just unzip them to the splashimages folder. After installing the splash screen images, the flash drive is ready to test or use.

Link for the splash screens: splashscreens

Nine (9) splashscreen files are provided. Download them as an album and extract to the splashimages folder. Slightly change the filenames by removing the number and dash so the filenames match those used in the menu configuration files.

The correct splashscreen filenames are:

  1. cave_800x600_14.png
  2. fallleaf_800x600_14.png
  3. grassyhill_800x600_14.jpg
  4. mist_800x600_14.png
  5. nightlight_800x600_24.jpg
  6. ny_800x600_14.jpg
  7. road_800x600_14.png
  8. Spruce_800x600_14.png
  9. winter_800x600_14.jpg.

The link below displays a directory of what the flash drive contents should look like at this point:

indexFlashDrive

Create and Install Customized Splash Screens (optional)

To create your own menu graphics, use the batch file below or another graphics program to create .png or .jpg format splash screens from your image files. Since the menus are already configured with light text, you may want to use a dark color to start off with. Generally, 14 colors works nearly every time and renders more quickly.

The batch file below is configured to use ImageMagick portable installed to the Utilities folder. If ImageMagick is already installed, simply change the line set IMdir=C:\Utilities\ImageMagick\ to your ImageMagick location. Use double quotes if the path contains spaces (e.g., set “IMdir=C:\Program Files\ImageMagick\”). Be sure to use the latest version of ImageMagick since the newest version has improved image conversion options and processing.

convert_syslinux_rev4b.bat

If creating a customized splash screen, place it in the splashimages folder in the flash drive and change the file name in the appropriate menu configuration file(s) as below so it can be used on the next boot:

MENU BACKGROUND /splashimages/your image name.jpg

5. Customize Menu Configuration Files (optional)

After the flash drive is working properly, try to install bootable applications or Linux distros by modifying the boot options in the menu configuration files for Syslinux or in menu.lst for Grub4Dos. Some menu label entries are already provided in the Syslinux menus that were verified to work such as Slax, Grub4Dos, and a few others.

That’s it. If anything gets messed up, everything can just be reinstalled and started again from the beginning. Good luck.

 

References:

Syslinux – https://www.syslinux.org/wiki/index.php/SYSLINUX

Syslinux Menu – https://www.syslinux.org/wiki/index.php/Menu

Syslinux 6 Changelog – https://www.syslinux.org/wiki/index.php/Syslinux_6_Changelog

Memdisk – https://www.syslinux.org/wiki/index.php/MEMDISK#ISO_images

 

Share
01. January 2013 · Comments Off on Common GRUB 2 Option Tweaks for Debian, Ubuntu and Mint · Categories: Linux · Tags: Boot Loaders
Last updated on 11/13/2023

Since version 1.98, GRUB 2 began replacing GRUB version 0.9x, which is now known as GRUB legacy. GRUB 2 represents a major revision over its predecessor to make it more portable and modular. And although GRUB legacy is no longer being developed, bug fixes for it continue, and it’s still used as the default boot loader for a number of Linux distros. Over time, GRUB 2 usage has steadily increased and while still a work in progress, it’s probably the most common boot loader for Linux distros. Although GRUB 2 is officially known as GRUB, Linux distro repositories may include GRUB 2, GRUB legacy, or both versions. Repositories that include both versions may make the distinction between them as GRUB 2 and GRUB, GRUB and GRUB legacy, or GRUB 2 and GRUB legacy. The naming inconsistency between distros can be somewhat confusing, but this is to be expected during any transition.

What is covered in this guide

This is not a comprehensive guide on GRUB 2; rather, this is a quick reference covering frequently used GRUB 2 tweaks and option edits for most Linux distros; particularly those based on Debian/Ubuntu/Mint or Slackware. For detailed information about GRUB 2, see the references at the end of this guide.

This guide assumes that the reader already has GRUB2 installed for a single boot or a multiboot Linux system. Note that all changes to GRUB 2 options must be done while logged in as root or by use of sudo. All commands and options described should be verified for correctness using the documentation for your particular Linux distribution.

GRUB 2 summary

Recent converts to GRUB 2 probably have noticed that the Boot menu basically looks the same as GRUB legacy. Although they appear similar, the way GRUB 2 generates its menu is very different. Also, GRUB 2 now places its files in three locations:

  • /boot/grub/grub.cfg  (GRUB 2 main configuration file, replaces menu.lst, a product of the script files in /etc/grub.d/)
  • /etc/grub.d/  (directory containing several GRUB 2 script files)
  • /etc/default/grub  (GRUB 2 customization file)

Most GRUB 2 files are updated/regenerated automatically during package updates, when new kernels are added, after installing additional OS’s on multi-boot systems, or whenever GRUB is manually updated after making changes to the GRUB options as described in this guide. Generally, editing these files is not recommended, not only because it can cause boot problems, but also because most of the files will be overwritten anyway during system updates. The single file that users can generally edit without issue is /etc/default/grub, which holds most of the settings that will be of interest to users reading this. This file contains customization settings such as the default menu entry, timeout, default boot, graphics, and more. An example GRUB file from Lubuntu 12.10 (original settings slightly modified) is shown below:

# If you change this file, run '<strong>update-grub</strong>' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

<span style="color: #000000;">GRUB_DEFAULT=0</span>
<span style="color: #000000;">#GRUB_HIDDEN_TIMEOUT=0</span>
GRUB_HIDDEN_TIMEOUT_QUIET=true
<span style="color: #000000;">GRUB_TIMEOUT=-1</span>
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
<span style="color: #000000;">GRUB_CMDLINE_LINUX_DEFAULT=""</span>
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
<span style="color: #000000;">GRUB_GFXMODE=auto</span>

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Quick Edits for /etc/default/grub

Note: A grub file can contain many more options than those shown in the above file. For a full list of options refer to the GNU Grub Manual (link in reference section below). Note that all GRUB 2 commands or changes to its files must be done while logged in as root or by using sudo.

As previously mentioned, the above sample GRUB 2 file is essentially the same as the default file for Lubuntu ver. 12.10. Note that the option entries listed in the above file may differ for other Linux distributions and/or versions. In most cases, users will want to make minor changes to the option entries that are common to all distributions and/or versions, such as timeout, default boot OS, displayed boot information (quiet splash), or the display resolution. To enable a listed option, remove the comment (#) in front of the option entry and change its value as appropriate. If a desired option is unlisted, it may be added to the end of the file. Also notice that the above file contains comments that provide information for enabling/disabling many of the listed options. After making any change to this file, it must be saved and GRUB updated in order for the changes to take effect on the next boot (see saving and updating section below). A few common option entries are described as follows:

GRUB_DEFAULT=0
Default option setting is 0.
This is the default menu entry to be booted. Zero (0) is the first boot option listed in /boot/grub/grub.cfg.

GRUB_TIMEOUT=-1
Default option setting is 5.
Sets the time in seconds that the boot menu displays before it automatically boots the default boot entry. If a key is pressed before that time, the timeout is cancelled, allowing manual selection of the entry with no time limit. The value “-1” causes the menu to be displayed indefinitely.

GRUB_CMDLINE_LINUX_DEFAULT=””
Default setting is distro dependent.
Passes arguments to the end of the boot command line for the kernel of the menu’s default entry. Added in addition to any arguments specified in GRUB_CMDLINE_LINUX below. This option is often set to “quiet splash” to suppress boot information and display the splash screen. Note that “quiet” and “splash” are separate values. Remove “quiet splash” between the parentheses to display all boot information without a splash screen.

GRUB_CMDLINE_LINUX=””
Default setting as above.
Passes arguments to the end of the boot command line for the kernels of all the menu entries.

GRUB_GFXMODE=auto
Default setting is “auto”.
Sets the graphical terminal resolution. Only modes supported by the graphics card VESA BIOS Extensions (VBE) can be used. To determine the available screen resolutions, type “c” for a command line at the GRUB 2 boot menu and then enter “vbeinfo.” The syntax for the option value is widthxheight[xdepth]. Some common option values are 1400x900x32, 1024×768, and 800×600.

#GRUB_DISABLE_RECOVERY=true
Recovery mode entries are generated by default.
Enable by removing #, which will disable generation of the recovery mode entries; otherwise, for each Linux kernel, at least two menu entries will be generated – the default entry and a recovery mode entry.

Saving and updating the edited /etc/default/grub file

After editing and saving the /etc/default/grub file the following command must be executed for the changes to take effect:

sudo update-grub

To restore the default settings for GRUB 2, reinstall GRUB 2 by executing the following command:

sudo grub-install /<target>

Where <target> /dev/sda, /dev/hda

GRUB 2 tools

Graphical tools for configuring Grub 2 have become more common as Grub 2 matures. One GUI tool available on many repositories is grub-customizer. See this How-to-Geek article for a description of this tool.

Changing the GRUB 2 background image

 

Good tutorials describing how to change the GRUB 2 background image:

The Geek Stuff – How to Change GRUB Splash Image, Background, Font Color on Your Linux

 

References:

GNU GRUB Manual

openSUSE® – Chapter 10. The Boot Loader GRUB2

GRUB 2 bootloader – Full tutorial by Dedoimedo

Official Ubuntu Community Documentation – Grub 2

Grub 2 Basics by DRS305 – Ubuntu Forums

 

Share
09. December 2010 · Comments Off on Create Custom Grub4Dos, GRUB and Syslinux Compatible Splash Images · Categories: Batch Files, Graphics · Tags: batch files, Boot Loaders, Linux
Last updated on 12/07/2017

Syslinux Boot Menu ScreenThis guide demonstrates how to quickly and easily create custom 640×480 splash images for Grub4Dos, GRUB, and Syslinux menus using the Windows version of ImageMagick. The information in this guide was tested with Grub4Dos ver 0.4.4, GRUB ver 0.97, and Syslinux ver 4.04. Both of these Grub4Dos and GRUB versions have nearly the same requirements for splash images so that the same images can be used by either one. The formats are xpm for GRUB/Grub4Dos and png/jpg for Syslinux.

This guide does not cover splash images for GRUB2, the newest version and replacement for GRUB, which only recognizes the .tga, .jpeg, and .png image formats. GRUB is now officially known as GRUB Legacy, and while no longer developed as of version 0.9x, it is still being supported and enhanced, so GRUB will continue to remain a very usable boot-loader for the immediate future. Syslinux graphical menus are generated using the vesamenu.c32 module, which must be included in the boot medium. Syslinux Hi-color menus, like GRUB and Grub4Dos menus, also use a 640×480 size splash image, but have slightly different requirements as explained below. Also, Grub4Dos and GRUB have some splash screen requirements that are not specified in the Syslinux documentation, so apparently those particular graphical attributes are either not applicable or have no limitations in Syslinux.

grub4dos menu screenThis is a quick and dirty method that was tested to work as specified for this guide. The aim of this guide is to quickly generate custom splash images from existing images rather than to create works of art. As such, the quality of the finished images largely depends on the initial quality and size of the original image files.

The requirements for Grub4Dos or GRUB splash screen images are:

  • The image must use the .xpm format (.xpm files are usually g-zipped for faster loading).
  • The image must be exactly 640×480 pixels in size.
  • The image can’t have more than 14 colors.

The requirements for Syslinux Hi-color splash screen images are:

  • The image must be in the .png or .jpg format.
  • The image must be exactly 640×480 pixels in size.
  • Image depth and number of colors requirements appear to be unspecified. For this guide, the depth is set to 16 bits and the number of colors is set to 14 in the ImageMagick convert command line to obtain a smaller file size. For some images, the user may wish to increase the number of colors for better quality results.

Tools:
In Windows, the only tools required to create splash images are the ImageMagick freeware graphical image suite and a text editor to create batch files such as notepad. ImageMagick is a command-line only tool that’s fairly easy to use. As a command-line application, commands are executable from batch files or with other scripting languages. The self-installing version of ImageMagick automatically sets the registry entries, making it possible to execute it from any directory. If using the portable version, the path variable needs to be set manually or specified in a batch file to achieve this functionality. ImageMagick portable for Windows, ImageMagick-6.7.4-Q16-windows.zip, was used for this guide and tested on PCs running Vista and WinXP.

Image files to convert:
In most cases, make sure images are in the .bmp, .jpg, or .png format and are 640×480 pixels in size or have the same aspect ratio (e.g. 800×600, 1024×768, etc.) before converting them. If images are in any other format or don’t have a 640×480 aspect ratio, re-size them and change the format to .bmp, .jpg, or .png before using ImageMagick. For Grub4Dos or GRUB boot menu screens, if another original image format is used, such as .gif, ImageMagick will process it without error, but the image may be distorted or render incorrectly. Files can easily be re-sized and converted to .bmp, .jpg, or .png formats using most graphical editing programs already on your computer. Note that the .png format usually results in a slightly smaller file size than the .bmp format.

Note: ImageMagick’s
resize operator is designed to produce the best possible result for the requested image size (i.e. 640×480) and ignores aspect ratio if image distortion occurs during the conversion process. Thus the re-size operator does not necessarily scale the image! That is why it’s important to use true 640×480 pixel images (or images with the same aspect ratio (e.g. 4:3) before converting them with ImageMagick. Make sure to verify image size after converting with ImageMagick. The final size of images must be exactly 640×480 to work as splash screens.
______________________________________________________________________________

Steps to Create Grub4Dos and GRUB Compatible Splash Images:

Step 1: Download and Install ImageMagick

Step 2: Convert Image Files into Grub4Dos or GRUB Compatible Images with the ImageMagick command line:

Open a command window in Windows by clicking the Start button, select RUN…, then type “cmd” and click the “OK” button. In the command window, navigate to the directory where the files are located and use the following command to convert each file to a Grub4Dos and GRUB compatible splash image:

convert -resize 640x480 -colors 14 filename.bmp filename.xpm.gz

To install a Grub4Dos or GRUB splash image in menu.lst:

  • Copy the splash image to your HDD (e.g. hdo, hd1, etc.) or USB (e.g. sda1, sdb2, etc.) in the default folder or in a folder of your choice
  • Edit the menu.lst file to reflect the location of the splash image:

    splashimage (hd0,0)/yourfolder/filename.xpm.gz

Batch file example:

Drag and drop single or multiple .bmp, .jpg, or .png images into the batch file to automatically convert them into GRUB or Grub4Dos compatible splash screen images. Click to open the file link in your browser and then cut and paste the code into a text editor or right click to download the batch file code. Be sure to change the file extension to .bat before using:

convert_oldgrub_grub4dos_rev2.bat (drag and drop a single file or multiple files into this batch file)

convert_grub_rev3a.bat (updated script with more options)
_________________________________________________________________________

Steps to Create Syslinux Compatible Splash Images:

Step 1: Download and Install ImageMagick

Step 2: Convert Image Files into Syslinux Compatible Images using the ImageMagick command line:

Open a command window in Windows by clicking the Start button, select RUN…, then type “cmd” and click the “OK” button. In the command window, navigate to the directory where the files are located and use the following command to convert each file to a Syslinux compatible splash image:

convert -resize 640x480 -depth 16 -colors 14 yourfile.bmp yourfile.png

Note: Increasing colors from 14 to a higher value in the above command can result in higher quality images, but also slightly increases the file size.

To install a Syslinux splash image:

  • Make sure the vesamenu.c32 module is installed to the boot medium (get it from the Syslinux com32\modules\ folder). Vesamenu.c32 is usually placed in the same folder or partition as the syslinux.cfg file.
  • Copy the splash image to your HDD (e.g. hdo, hd1, etc.) or USB (e.g. sda1, sdb2, etc.) in the default folder or in a folder of your choice
  • Edit the syslinux.cfg file to reflect the location of the splash image:

    MENU BACKGROUND /yourfolder/yourfile.png

Batch file example:

Drag and drop single or multiple .bmp, .jpg, or .png images into the batch file to automatically convert them into Syslinux compatible splash screen images. Click to open the file link in your browser and then cut and paste the code into a text editor or right click the link to download the batch file code. Be sure to change the file extension to .bat before using:

convert_syslinux_rev2.bat (drag and drop single or multiple files into this batch file)

convert_syslinux_rev3a.bat (updated script with more options)
____________________________________________________________________

References:

Fedoraproject.org wiki – How to create a custom syslinux splash

ImageMagick – Resizing Images

Syslinux.zytor.com – Comboot/menu.c32

 

Share
03. March 2010 · Comments Off on Create a Multiboot Multipartition USB with Syslinux and Grub4Dos · Categories: Multiboot USB · Tags: Boot Loaders, Linux
Last updated on 12/12/2022

This guide illustrates how to manually create a multi-boot multi-partition USB drive using both SYSLINUX and GRUB4DOS. Because many apps and Linux distros are coded and/or organized in a way intended to operate from dedicated single partition USB drives, they are often notoriously difficult to boot from multi-boot USBs. Thus, while many apps and distros state they are bootable from USBs, often this means they are bootable from single-purpose (and single partition) USB drives, often using UNetbootin or similar utilities. Seldom, if ever, are directions provided for installation to an existing multi-boot environment, or how to create a multi-boot USB in the first place. To get around this limitation, this guide demonstrates how to setup a USB drive to enable booting several apps and distros from a single partition and from multiple dedicated partitions.

Almost any distro or app can be made to boot from a USB, with some being easier than others. Sometimes it’s as easy as extracting files and folders from a zip file to the USB and installing a boot-loader. However, more often it’s not always so simple; especially when attempting to install apps or distros to a partition already cluttered with multiple ISOs, image files, compressed files, system files, configuration files and various folders. For the sake of brevity and simplicity, this guide covers selected apps and distros that were tested to work. By following this guide, it should become apparent how to install other apps and distros or updated versions of those that are included here.

For this guide, SYSLINUX is used as the primary boot loader. GRUB4DOS is used as a secondary boot-loader to chainload partitions (Chain-loading is a process where control passes from the boot manager to the boot sector) and to boot ISOs and other apps in the active partition. In this case, GRUB4DOS is used to pass control (chainload) to Syslinux installed on the dedicated partitions’ boot sectors (except for the active partition, which is directly booted with SYSLINUX). The advantage of GRUB4DOS is that currently, it’s MUCH easier to chainload partitions and to boot ISOs using GRUB4DOS than with SYSLINUX, which is really designed to chainload hard drive partitions rather than USB drive partitions. Also, some applications (like ISOs) can boot easily with GRUB (or GRUB4DOS), but not always with SYSLINUX. Usually, anything that will boot with GRUB can also boot with GRUB4DOS, as long as it’s installed to a FAT formatted partition (either FAT16 or FAT32). It’s also important to note that Syslinux is limited in that it can’t access files outside of its own partition. However, when GRUB4DOS and SYSLINUX are used together, this greatly expands the booting options for USB drives. So essentially, as used here, GRUB4DOS is used to boot ISOs and a few other apps on the active partition and to control (chainload) dedicated partitions containing a single app or distro. Once control is passed from GRUB4DOS, the dedicated partition automatically boots the application or app with SYSLINUX, which is installed to the partition’s boot sector.

It’s important to note that all the applications and distros installed to the dedicated partitions for this guide are already designed to boot with SYSLINUX, so all that’s necessary is to copy their files to a partition, install SYSLINUX to the partition’s boot sector, and setup GRUB4DOS to boot the partition in order to use the SYSLINUX default menu options included in the syslinux.cfg files. Using SYSLINUX to automatically boot dedicated partitions provides the advantage of being able to use the boot options in the default syslinux.cfg files that otherwise wouldn’t be available using a single boot-loader and without manually creating, editing and maintaining complex and excessively large syslinux.cfg and/or menu.lst files.

This guide is an extension of an earlier one, Booting DSL (Damn Small Linux) from a Multiboot USB Drive, which demonstrated how to add DSL to a working bootable (either single or multi-boot) single partition USB drive with SYSLINUX. Although creating multi-boot USBs can be accomplished in many other ways, after much trial and error, the method here may be one of the easier ways to boot several popular distros and apps from the same partition and/or from multiple partitions for USB drives. This guide assumes the user has some experience with booting external devices, using partitioning tools, creating Live CDs from ISOs, and has a basic knowledge of Linux, SYSLINUX, and GRUB4DOS.

____________________________________________________________________________________

Operating Systems:

Boot-loader and partitioning utilities to download. Extract to “C:” or another location of your choice on a Windows computer.

  • GRUB4DOS (ver 4.4 used for this guide, new versions from grub4dos-chenall should also be OK)
  • SYSLINUX (ver 3.84 used for this guide, ver 3.86 also tested OK, but higher versions such as 4.02 may be incompatible with the distros and app versions used for this guide)

Note: The SYSLINUX version used to boot partitions must be compatible with any SYSLINUX module files included with the app or distro. That is why versions are provided — to insure compatibility. For instance, if you want to install a more recent version of Parted Magic to the USB and it contains an upgraded vesamenu.c32 module and you are using a previous version of SYSLINUX that doesn’t support that change; then you may not be able to boot the USB unless you also upgrade SYSLINUX to a compatible version .

Tested distros and applications used for this guide (download links are provided below in the article body):

Partition 1 (Device boot partition)
Puppy Linux ver 4.31 (booted directly with SYSLINUX)
SuperGrubDisk ver 0.9799 (booted directly with GRUB4DOS)
WinME Non-Windows Based Image File W/ImageApp (booted directly with either SYSLINUX or GRUB4DOS)

Partition 2 (dedicated – primary)
DSL (Damn Small Linux) ver 4.4.10-embedded (chainload boot with SYSLINUX from GRUB4DOS)

Partition 3 (dedicated – primary)
Parted Magic LiveUSB ver 4.7 (chainload boot with SYSLINUX from GRUB4DOS)

Partition 5 (dedicated – logical)
AVG Rescue USB ver 90-100429 (chainload boot with SYSLINUX from GRUB4DOS)

Partition 6 (dedicated – logical)
Clonezilla Live (for USB – zip file) ver 1.2.4-28-486 (chainload boot with SYSLINUX from GRUB4DOS)

Note: If versions other than those shown above are used, the USB’s syslinux.cfg and/or menu.lst files, as well as Syslinux itself, may need to be updated to reflect this change and to boot correctly.

Hint: Downloading the above distros and apps to another USB drive, an external HD, or burning them to a CD will ease the task of copying and extracting them to the USB partitions later in this guide.

Text (*.txt) versions of the configuration files for SYSLINUX and GRUB4DOS are pre-configured and provided in this guide. Included are:

_____________________________________________________________________________________

Here are the steps to follow to create a multi-boot and multi-partition USB drive:

About Partitioning and Formatting

First, decide on the number and size of the partitions needed to hold everything to be installed. Although not covered in this guide, it’s often a good idea to have at least a couple of extra partitions and some unallocated space for future expansion and for apps that are to be booted from dedicated partitions (to utilize multiple boot options). Note that any storage drive device is limited to a maximum of four primary partitions. To partition a drive with more than four partitions, it’s necessary to create at least one as an extended partition and to create one or more logical ones within that extended partition. More often than not, it’s possible to boot several apps and distros (especially ISOs) from the same partition (particularly the active partition), so sometimes it’s desirable to create a large active partition to hold several booted apps and some smaller ones just large enough to hold the apps or distros that require their own partitions. For simplicity, this guide uses a 2GB USB drive divided into five approximately equal primary partitions (3 primary, 2 logical) of about 400MB each. The first partition will boot multiple distros and apps, with the other four setup as dedicated partitions (booting a single app or distro).

1. Boot the PC with the Parted Magic LiveCD and use GParted to Partition the USB drive

a. Connect the USB drive and boot the computer using the Parted Magic LiveCD. In Parted Magic, start the GParted Partition utility and set it to display the USB drive.
b. Use GParted to create three 400MB primary partitions and two 400MB logical partitions in an extended partition of 800MB. Be sure to format the partitions with FAT16 or FAT32 (It’s recommended to use either FAT16 or FAT32, but do not use both) and set the boot flag for the first partition. You can also provide identities for the partitions using labels. See the example GParted image below which uses three primary partitions and one extended partition. The partitions are labeled as 1, 2, 3, 5 & 6 (4 is the extended partition holding logical partitions 5 & 6. Partition 4 itself isn’t writable). Make sure no errors are showing for any partition before moving to the next step.

GParted Partition Layout

For step 2, Parted Magic can continue to be used; however, users may find tasks such as copying, moving and extracting files somewhat easier using a more familiar Linux distro such as Ubuntu, Puppy, etc. Parted Magic is suggested for steps 1 to 3 because it contains GParted, SYSLINUX, a file manager and LXTerminal all in one package, which are all used in this guide. In any case, a non-Windows environment such as Linux must be used to copy the files to all the partitions (except the boot partition) since Windows is only able to access the bootable (active) partition of USB drives.

2. Using Parted Magic or another Linux Distro, install Applications and Distributions

Note: The file ldlinux.sys shown in each of the following screen-shots will not exist until steps 3 and 4 are completed.

Partition #2 – DSL (Damn Small Linux)
DSL can be booted two ways: (1) from it’s own partition, or (2) co-existing with other apps and distros on the same partition. This guide will boot DSL from its own partition (first method), using the default DSL syslinux.cfg file that comes with DSL which provides multiple booting options. The other method, installing DSL to co-exist with other apps and distros in a single boot partition (second method) was covered in a previous article: Booting DSL (Damn Small Linux) from a Multiboot USB Drive.

a. Download DSL Embedded. Ver 4.4.10-embedded used for this guide.
b. Extract DSL Embedded to Partition #2 and copy all the files in the main folder to the root of the partition (erase the original folder afterward). The root of the partition should look like this:

Partition #2

Partition #3 – Parted Magic
a. Download Parted Magic LiveUSB. Ver 4.7 used for this guide.
b. Extract to partition #3 and place the two folders, pmagic and boot in the root of the partition (erase the original folder(s) afterwords). The root of the partition should look like this:

Partition #3

Note: Parted Magic is in it’s own partition to avoid boot conflicts. Parted Magic, like the other distros and apps installed to dedicated partitions, already comes with a customized syslinux.cfg file. Parted Magic’s syslinux.cfg file is located in the boot folder (DSL’s and AVG’s syslinux.cfg file are located in root, and Clonzilla’s is located in the syslinux folder). During the booting process, SYSLINUX automatically searches for the syslinux.cfg file in the following order:

/boot/syslinux/syslinux.cfg
/syslinux/syslinux.cfg
/syslinux.cfg

Note: The boot order above shows why Parted Magic and many other distros and apps should be placed in their own partitions. Should another syslinux.cfg file be placed in root, it would be ignored and the Parted Magic syslinux.cfg file would always load since “boot/syslinux/syslinux.cfg” is first in the boot order. Of course, there are ways to get around this, but the goal of this guide is to create a multi-boot USB quickly and easily without modification to the original file contents and structure so that the default boot options for the installed apps and distros are used.

Partition #5 – AVG Rescue CD
a. Download AVG Rescue (for USB Stick). Ver 90-100429 used for this guide (avg_arl_cd_en_90_100429.zip).
b. Extract to Partition #5. The root of the partition should look like this:

Partition #5

Partition #6 – Clonezilla
a. Download Clonezilla Live (for USB – choose the zip file). Ver 1.2.4-28-486 used for this guide.
b. Extract to Partition #6. The root of the partition should look like this:

Partition #6

Partition #1 – Puppy Linux/SuperGrubDisk/WinME Boot Image/Anything else
a. If you have a working frugal installation of Puppy Linux Ver 4.31 copy all of its files to a folder named “puppy”. The minimum files required for a frugal install of puppy 4.31 to a USB are: initrd, pup_431.sfs, usbflash, and vmlinuz.
b. Download SuperGrubDisk ISO (ver 0.9799) and place the ISO in a folder named “sdg” (yes, “sdg” is correct).
c. Download WinME Non-Windows Based Image File W/ImageApp and extract it to its default folder “winmec”.
d. Try other programs of your own.

Note: Not all ISOs are bootable using GRUB4DOS. Often, identifying bootable ISOs is a trial and error process using various boot options to determine whether it’s possible to do so without modifying the ISO image. All the ISOs used in this guide were tested to insure they were bootable without modification.

Click here for the screen-shot of Partition #1, or scroll further down this page

3. In Parted Magic, install SYSLINUX to Partition Boot Sectors

Note: another excellent tool to perform steps 3 and 4 is Bootice V0.8.2010.1228, which operates in Windows and can access multiple partitions. It can analyze partitions, format the USB drive, install and restore MBRs and PBRs, and more. Bootice is fairly easy to use; see Easily Modify Boot Sectors with Bootice for more information.

In Parted Magic, open a LXTerminal window and type the following commands to install SYSLINUX to all partition boot sectors except for the boot partition (partition #1). Be sure to substitute your USB device in place of sdb(x). Press ENTER after each of the following commands:

syslinux –install /dev/sdb2
syslinux –install /dev/sdb3
syslinux –install /dev/sdb5
syslinux –install /dev/sdb6

Exit Parted Magic and boot the computer to Windows for the next steps.

The above commands install SYSLINUX to the partition boot sectors for the 2nd to 6th partitions (4th excluded), and places the file ldlinux.sys into each partition’s root directory. These commands make the partitions bootable using GRUB4DOS. The device itself is bootable because of the boot flag in the first partition.

Note: you will not see a response each time the above commands are executed unless there is an error.

4. In Windows, install SYSLINUX and the MBR for the USB Drive (use Windows for the remainder of Steps)

a. Exit Parted Magic and reboot the computer to Windows. Open My Computer to identify the Windows USB drive letter assignment.

Note that for hard drives, Windows can access multiple partitions, but for USB drives, Windows can only access a single bootable partition.

b. Open a CMD window using Start -> Run -> enter “CMD” and then hit OK. In the CMD window, navigate to the win32 folder of the extracted Syslinux folder. For example, if you extracted SYSLINUX to C:\syslinux-3.84, then cd to “syslinux-3.84\bios\win32” and enter the following command: “syslinux.exe -sfma x:” Be sure to substitute “x” with the letter assignment of your USB drive identified in My Computer.

This is an explanation of the above syslinux.exe command from the SYSLINUX Wiki:
-s Safe, slow, stupid: uses simpler code that boots better.
-f Force installing.
-m MBR: install a bootable MBR sector to the beginning of the drive.
-a Active: marks partition #1 active (=bootable)

(Note: Setting the boot flag was done already in GParted, but it won’t hurt to do it again).

The above command installs a bootable MBR to the first partition of the USB drive, making SYSLINUX the boot manager for the USB device.

5. Copy GRUB4DOS to Root of Partition #1

Because SYSLINUX is the primary boot-loader for the USB Drive, only two files are needed to boot GRUB4DOS: (1) “grub.exe” and (2) “menu.lst”.

a. From the extracted GRUB4DOS folder, copy and paste “grub.exe” to Partition #1 (see next section for menu.lst).

6. Create and Configure the syslinux.cfg file and menu.lst Files to Root of Partition #1

a. Save the following two files as syslinux.cfg and menu.lst (either open in your browser by clicking them to cut and paste or right click the links and save):

syslinuxcfg.txt (be sure to save as syslinux.cfg)
menulst.txt (be sure to save as menu.lst)

The syslinux.cfg file is used to set the configurable defaults for SYSLINUX. The menu.lst file sets the configurable defaults for GRUB4DOS. Note that the “l” in menu.lst is a small “L” and not the number “1”. Both files can be edited using a simple text editor.

7. Add Additional Modules to Root of Partition #1

Copy the following modules from the SYSLINUX extracted folder to the root of Partition #1:

  • vesamenu.c32 from “com32\menu” (optional – creates a fancier menu with splash image. See Create Custom Grub4Dos, GRUB and Syslinux Compatible Splash Images for using splash images with vesamenu.c32)
  • reboot.c32 from “com32\modules” (required – adds an option to reboot the computer)
  • menu.c32 from “com32\menu” (required – displays the basic Syslinux menu shown below)
  • memdisk from “memdisk” (required – kernel to boot floppy images, disk images and some ISOs)

Optional:
Save the following two files and save them to the root of Partition #1 (either open in your browser by clicking them to cut and paste or right click the links and save):

submenulst.txt (save as submenu.lst) Provides an extra menu for GRUB4DOS to boot other apps and distros if needed
help.txt (save as help.txt) Provides a user-defined help menu when F1 is pressed while the Syslinux menu is displayed

Partition #1 should now look like this:

Partition #1

If you followed the above instructions, you should have a working multi-boot, multi-partition USB. The SYSLINUX boot screen should be similar to the screen-shots below when you boot the USB drive. If you receive boot errors when booting to or selecting from the SYSLINUX menu, try installing SYSLINUX to the partition boot sectors again (step 3) and reinstalling the SYSLINUX/MBR to the boot partition (step 4). Also, use GParted to view the partitions for any errors. Errors in GParted will display as a yellow triangular symbol for that partition.

Syslinux Boot Menu ScreenSyslinux Boot Menu Screen
GRUB4DOS Boot Menu Screen
GRUB4DOS Boot Menu Screen

Other free Windows based Multi-boot USB creation Tools:

XBOOT – Another tool to create multi-boot USBs and ISOs. No personal experience with this tool as of yet. Requires the .NET framework ver 4.

SARDU (Shardana Antivirus Rescue Disk Utility). No personal experience with this tool as of yet.

Share
support
">Bear

Bad Behavior has blocked 1876 access attempts in the last 7 days.