Everybody likes to use, test and hack with mini distros, but no one likes to burn a separate CD for each since a distro only takes up a small fraction of the CD space. This results in low resource utilisation and increases junk. What if we could keep all the distros on one single CD or even all the distros on one USB drive, and boot the distros directly from there through an interactive menu system? Yes, that’s what we are going to do! We are going to pack seven mini distros into one CD/DVD or USB drive that’s ready-to-boot, so that we can carry them around and boot any distro anywhere, anytime, and at any place.
This guide is written with primarily a CD/DVD as the target medium, but we will also show you how this can be done with a Flash drive. We will pack PuppyLinux, GeexBox, Slitaz, Goblinx (mini), Austrumi, CDlinux (standard) and DSL into a CD and USB drive.
The whole process is divided into seven phases. Each phase is further sub-divided into numbered sections. Follow Phase I through to Phase IV; then to make a live CD, follow Phase V. Alternately, to create a live USB drive, follow Phase VI, then continue serially.
At all times keep two terminals open—one as the normal user, and another with super-user privileges. In both the terminals, always remain fixed inside a working directory, the work_dir/
. We will either point directories/files relative to word_dir/
or in an absolute path. If some source packages are required to be compiled, launch a new terminal in the source directory, carry on the compilation and terminate it.
When you see the ‘#’ symbol beside a command, switch to the root console and execute; and when you see ‘$’, run it in normal user terminal.
If there are not enough permissions when trying to modify/remove some file, then chmod
it with the appropriate permissions first.
When describing the USB booting, we will call the USB partition ‘/dev/sdXy
’, where ‘X
’ is the disk alphabet (number) and ‘y
’ is the partition number. Replace X
and y
as per your drive’s values. In my case it was ‘/dev/sdb1
’ (X=b, y=1)
Warning: Always be extra careful when executing commands in super-user mode. Double check which device you are operating on when setting boot flags, bootloaders, etc, or you may render your system unbootable.
Phase I: Preparation
Create the work_dir/
directory into which we will dump all the resources. Create mbcd/
and boot/
directories in chains inside work_dir/
. We’ll use mbcd/
to hold the compiled image files, while boot/
will hold the boot files for the image. Then change directory to word_dir/
and be sure to remain fixed in this location.
$ mkdir -p work_dir/mbcd/boot $ cd work_dir
Download the distros and then copy them into work_dir/
. Create temporary directories in /mnt/
, which we will use as mount points of the ISO images. (You can mount one image and then unmount it to reuse it, but for easy reference we will mount all the ISOs at once.) Make seven directories, tmp1/
to tmp7/
in /mnt/
.
# mkdir /mnt/tmp{1,2,3,4,5,6,7}
We will now mount the ISO images in the mount point directories. Remember to keep track of which OS is mounted in which directory. You can name the directories accordingly, such that you can identify each from its name. But for simplicity, we will refer to them as tmpX
.
Austrumi, Puppy Linux, Slitaz, CDlinux, DSL, GeeXboX, and GoblinX (Micro) will be mounted into tmp1/
, tmp2/
, tmp3/
, tmp4/
, tmp5/
, tmp6/
and tmp7/
, respectively. We will set the owner and group of the mounted images to your normal user account and its group, by specifying the UID (user ID) and GID (group ID) options.
As a normal user, run id -u
and id -g
to find out the user and group IDs, respectively, and note them down. Replace <id>
and <group>
in the following commands with your UID and the GID, respectively.
# mount austrumi*.iso /mnt/tmp1 -o loop,uid=<id>,gid=<group> # mount puppy*.iso /mnt/tmp2 -o loop,uid=<id>,gid=<group> # mount slitaz*.iso /mnt/tmp3 -o loop,uid=<id>,gid=<group> # mount CDlinux*.iso /mnt/tmp4 -o loop,uid=<id>,gid=<group> # mount dsl*.iso /mnt/tmp5 -o loop,uid=<id>,gid=<group> # mount geexbox*.iso /mnt/tmp6 -o loop,uid=<id>,gid=<group> # mount goblinx*.iso /mnt/tmp7 -o loop,uid=<id>,gid=<group>
Change the distro ISO file names as per the downloaded file.
In this guide the OS versions are: Austrumi 1.7.2, PuppyLinux 4.0, Slitaz 1.0, CDlinux 0.9.1, DSL 4.2.2, GeexBox 1.2.2, and GoblinX Micro 2.7.
Note: If you decide to mount the images as the root user (without UID, GID options) then do the copy operations as the root. After you have done all the copying, chown
the copied files to the normal user.
Shortcut: You can skip Steps 3 and 4 of this phase, if you plan to use isomaster or file-roller and extract the required files in the subsequent phases.
Phase II: Copying
Now we will copy the OS files from the mount points to a proper location in our image directory. First let us understand the requirements briefly while copying the files.
Each OS has a kernel and an initial ramdisk file where the kernel is decompressed and gets loaded into the RAM. Then it loads the files needed, mounts the OS filesystem and runs programs to set up the OS.
The kernel and the initial ramdisk files are loaded through the bootloader from the media. There is a filesystem for each OS where all the programs, scripts and configurations are installed. In the mini distros, these are generally compressed, and/or encapsulated in a filesystem. For example, CDlinux and PuppyLinux use squashfs.
There may be more than one such filesystem for an OS, each containing the required files for a certain application software. For example, an additional squashfs module can be downloaded for OpenOffice.org, or Java runtime in PuppyLinux.
Some distros find the compressed filesystems in a certain location relative to the root of the bootable media. For some distros, the locations of the files can be altered, but information about the changed location should be conveyed by passing an appropriate boot parameter when booting, and so some distros can search their files in all the attached disks of the system, automatically.
To know the requirements of a certain OS, you should read the documentation in the official site, discuss it in forums or on the IRC channel. If you understand shell scripts, mount the initial ramdisk of the distro and read the loading script to decipher it.
After copying the OS files, make sure the copied files are accessible to the distros, and the different OS files don’t create any conflict. Although we’ll relocate some files and directories to avoid conflicts, we will, by and large, try to keep the copying clean with minimum relocations.
Some files might have read-only permission to the owner, in which case we’ll need to do a chmod u+w before modifying, deleting and overwriting it.
[1] Austrumi
Copy austrumi.fs
and austrumi.tgz
from /mnt/tmp1/boot/
into mbcd/boot/
:
$ cp /mnt/tmp1/boot/austrumi.* mbcd/boot/
Copy bzImage
and initrd.gz
from /mnt/tmp1/isolinux
to mbcd/boot/austrumi
.
$ mkdir mbcd/boot/austrumi $ cp /mnt/tmp1/isolinux/initrd.gz /mnt/tmp1/isolinux/bzImage mbcd/boot/austrumi
Austrumi searches for its files in the boot directory, so you need to keep it in there. From version 1.8.x of Austrumi, the kernel and the initial ramdisk files are located in the austrumi/
directory in the image.
[2] Puppy Linux
Puppy Linux does not need any specific location for the files to be kept; it finds its files from any attached media. We will place the Puppy files in a directory. Copy initrd.gz
and vmlinuz
into mbcd/boot/puppy
. Then copy pup_400.sfs
and zdrv_400.sfs
to mbcd/Puppy
.
$ mkdir mbcd/boot/puppy mbcd/Puppy $ cp /mnt/tmp2/initrd.gz /mnt/tmp2/vmlinuz mbcd/boot/puppy $ cp /mnt/tmp2/pup_400.sfs /mnt/tmp2/zdrv_400.sfs mbcd/Puppy
You can download and add additional Puppy .sfs
modules and keep them here.
[3] Slitaz
Now let me draw your attention to /mnt/tmp3
, the Slitaz mount point. Copy bzImage
and rootfs.gz
from /mnt/tmp3/boot
to mbcd/boot/slitaz
, and copy vmlinuz-<version_no>-slitaz
to mbcd/boot
.
$ mkdir mbcd/boot/slitaz $ cp /mnt/tmp3/boot/bzImage /mnt/tmp3/boot/rootfs.gz mbcd/boot/slitaz $ cp /mnt/tmp3/boot/vmlinuz-*-slitaz mbcd/boot
[4] CDlinux
Copy the bzImage
and the initrd
from /mnt/tmp4/CDlinux
into mbcd/boot/cdlinux
.
$ mkdir mbcd/boot/cdlinux $ cp /mnt/tmp4/CDlinux/bzImage /mnt/tmp4/CDlinux/initrd mbcd/boot/cdlinux
Then make a directory called CDlinux/
inside mbcd/
and copy the directories extra and settings into it.
$ mkdir mbcd/CDlinux $ cp -r /mnt/tmp4/CDlinux/extra /mnt/tmp4/CDlinux/settings mbcd/CDlinux
After this, copy the lang/
directory into CDlinux/
if required. When writing the configuration file in Phase IV, you can pass your language as the kernel parameter. CDlinux allows you to place customised packages inside the CDlinux/local
directory, which gets automatically detected when booting—so you can use it if needed.
[5] DSL
Now it’s time for DSL, mounted on /mnt/tmp5
. Copy linux24
and minirt24.gz
files from /mnt/tmp5/boot/isolinux
to mbcd/boot/dsl
.
$ mkdir mbcd/boot/dsl $ cp /mnt/tmp5/boot/isolinux/linux24 /mnt/tmp5/boot/isolinux/minirt24.gz mbcd/boot/dsl
DSL searches the cloop file (the Knoppix compressed loopback filesystem) in the KNOPPIX/KNOPPIX
path, by default. We will relocate it and keep it in the directory dsl/ instead, because if you decide to keep multiple Knoppix-based distros, which have the same cloop file name and path, you need to keep the cloops in different directories with different distro names. If the cloop path is altered, information about this change must be conveyed by passing a boot parameter while booting (discussed later). Copy the Knoppix cloop file from /mnt/tmp5/KNOPPIX/KNOPPIX
and place it into mbcd/dsl
.
$ mkdir mbcd/dsl $ cp -r /mnt/tmp5/KNOPPIX/KNOPPIX mbcd/dsl
[6] GeeXboX
Copy vmlinuz
, initrd.gz
and splash.png
file from /mnt/tmp6/GEEXBOX/boot
into mbcd/boot/geexbox
.
$ mkdir mbcd/boot/geexbox $ cp /mnt/tmp6/GEEXBOX/boot/vmlinuz /mnt/tmp6/GEEXBOX/boot/initrd.gz /mnt/tmp6/GEEXBOX/boot/splash.png mbcd/boot/geexbox
Then copy the whole of the /mnt/tmp6/GEEXBOX
directory into the root of our image and remove the boot directory inside mbcd/GEEXBOX
as we have moved all that’s required in mbcd/boot
. (chmod
is needed, as the directory has a permission of 444.)
$ cp -r /mnt/tmp6/GEEXBOX mbcd/ $ chmod -R u+w mbcd/GEEXBOX $ rm -rI mbcd/GEEXBOX/boot
[7] GoblinX mini
Copy vmlinux
and initrd.gz
of GoblinX from /mnt/tmp7/boot
into mbcd/boot/goblinx
.
$ mkdir mbcd/boot/goblinx $ cp /mnt/tmp7/boot/vmlinuz /mnt/tmp7/boot/initrd.gz mbcd/boot/goblinx
Then copy the /mnt/tmp7/goblinx
directory into mbcd/
.
$ cp -r /mnt/tmp7/goblinx mbcd/
This ends the copying process of our seven operating systems.
Phase III: Creating the boot directory
Now we will install the boot files that are required to make the ISO file or the USB bootable. We can use either the GRUB or SYSLINUX bootloader and we will cover the installation of both in this article. In Phase V we will either use GRUB or SYSLINUX to make the CD ISO image bootable (though both the bootloader files can reside in the image without conflicts).
[1] Installing GRUB
Make a directory named grub/
under mbcd/boot/
.
$ mkdir mbcd/boot/grub
To boot from the CD, Grub needs a special image for loading Stage 2. You need the stage2_eltorito
file. If you have got Grub installed in your system, then execute any one of the following commands and note the path:
$ locate stage2_eltorito
…or
$ rpm grub rpm -ql grub | grep stage2_eltorito
Else, download the GRUB source, compile it and get the eltorito image.
I am assuming you have stage2_eltorito
under /eltorito_dir
which represents the absolute path of the location of the stage2_eltorito
file in your system. Copy stage2_eltorito
into mbcd/boot/grub/
.
$ cp /eltorito_dir/stage2_eltorito mbcd/boot/grub/
Note: The Grub files that have to be copied in order to boot from the USB drive are described in Phase VI, Section [2].
[2] Installing SYSLINUX
Two files are required to install the SYSLINUX: isolinux.bin
is needed to make the image bootable, and vesamenu.c32
to enable the graphical menu system.
If you had SYSLINUX installed previously, then run one of the following commands and note down the paths:
$ locate vesamenu.c32 isolinux.bin
…or
$ rpm -ql syslinux | grep vesamenu.c32 && rpm -ql syslinux | grep isolinux.bin
If you do not have SYSLINUX, install it using your package manager. Or download the source from the SYSLINUX website, extract and run make
, but don’t install it (if you want to avoid installation—that is, only execute ./configure && make
). Get the required files from the source directory.
Make a directory called mbcd/boot/isolinux/
, and copy isolinux.bin
and vesamenu.c32
to mbcd/boot/isolinux/
.
$ mkdir mbcd/boot/isolinux $ cp /path_to/vesamenu.c32 /path_to/isolinux.bin mbcd/boot/isolinux
Shortcut: To avoid downloading and compiling SYSLINUX or Grub, just copy isolinux.bin
and vesamenu.c32
for SYSLINUX and stage2_extorito
file from any distro’s /boot
directory, and continue to the next step.
Phase IV: Making the configuration file
The previous phase sets the bootloader files; now we need to instruct the bootloader which OS to boot. We also need a menu from where the user can select an OS to boot and we need a configuration file. The Syntax differs in Grub and SYSLINUX. To know more about config file syntax, use the man pages.
Some distros need different boot parameters to be passed for USB and CD versions. We will present the configuration files for the live CD version in Section 1 (GRUB) and 2 (ISOLINUX) below, after which we will describe the modifications needed for the live USB version in Section 3.
[1] The Grub configuration file
The Grub configuration file will have three lines for each OS entry. The first line, “label text”, displays the entry that we see on a Grub menu. In the second line we specify the location of the OS kernel to be loaded, and pass the needed boot parameters. In the third line, we point the initial ramdisk through the initrd
command associated with the kernel.
You can add more than one entry for each distro, each using an OS-specific boot parameter. You can also write the parameters in a text file and display it when some key is pressed or use other ways to display text parameters. Check the man page for more details.
Everyone would like to add a cool boot screen to the ‘Multi-boot CD’. Make an image with the GIMP or download one and name it splash.jpg. To make it ready for Grub, keep it inside work_dir/
; then execute the following:
$ convert -colors 14 -depth 8 -resize 640x480! splash.jpg splash.xpm.gz
The above command transforms the image into 640×480 pixels, 14 colours XPM, and compresses it in a gzip file—splash.xpm.gz—so that Grub can display it. Move this into mbcd/boot/grub/
.
$ cp splash.xpm.gz mbcd/boot/grub
Shortcut: Download the readymade Grub loadable-format image from the Internet.
In the configuration file, add the following line to load it: splashimage=/boot/grub/splash.xpm.gz
.
Following is what the file looks like:
splashimage=/boot/grub/splash.xpm.gz title Austrumi #uncomment the below line for liveCD kernel /boot/austrumi/bzImage dolivecd #uncomment the below line for liveUSB # kernel /boot/austrumi/bzImage dousb initrd /boot/austrumi/initrd.gz title Puppy #uncomment the below line for liveCD kernel /boot/puppy/vmlinuz pmedia=cd #uncomment the below line for liveUSB # kernel /boot/puppy/vmlinuz pmedia=usbflash initrd /boot/puppy/initrd.gz title CDlinux kernel /boot/cdlinux/bzImage quiet initrd /boot/cdlinux/initrd title Slitaz kernel /boot/slitaz/bzImage rw root/dev/null vga=normal initrd /boot/slitaz/rootfs.gz title DSL #uncomment the below line for liveCD kernel /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 knoppix_dir=dsl nomce noapic quiet BOOT_IMAGE=knoppix #uncomment the below line for liveUSB # kernel /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 knoppix_dir=dsl nomce noapic fromhd quiet BOOT_IMAGE=knoppix initrd /boot/dsl/minirt24.gz title GeeXboX #uncomment the below line for liveCD kernel /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc boot=cdrom lang=en remote=atiusb receiver=atiusb keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet #uncomment the below line for liveUSB and replace the UUID value with your device UUID # kernel /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc boot=UUID=0196-F5B5 lang=en remote=atiusb receiver=atiusb keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet initrd /boot/geexbox/initrd.gz title GoblinX kernel /boot/goblinx/vmlinuz vga=791 ramdisk_size=6666 root=/dev/ram0 rw load=Muser locale=english splash=silent changes=/goblinx/ run.f initrd /boot/goblinx/initrd.gz
Go through it and check how the paths are changed. Just make sure that each absolute path within the CD (considering the mbcd/
directory as the root) is valid, and points to the correct kernel and ramdisk file.
Now save it with the name grub.conf
inside mbcd/boot/grub/
.
[2] The ISOLINUX configuration file
By changing some syntax of the above Grub file we can create the isolinux.cfg
file and save it in mbcd/boot/isolinux/
. The following snippet shows the contents of this file:
F1 list.msg DEFAULT vesamenu.c32 PROMPT 0 DISPLAY list.msg MENU BACKGROUND splash.jpg LABEL austrumi MENU LABEL Austrumi Linux #uncomment the below line for liveCD KERNEL /boot/austrumi/bzImage dolivecd #uncomment the below line for liveUSB # KERNEL /boot/austrumi/bzImage dousb APPEND initrd=/boot/austrumi/initrd.gz LABEL puppy MENU LABEL Puppy Linux #uncomment the below line for liveCD KERNEL /boot/puppy/vmlinuz pmedia=cd #uncomment the below line for liveUSB # KERNEL /boot/puppy/vmlinuz pmedia=usbflash APPEND initrd=/boot/puppy/initrd.gz LABEL cdlinux MENU LABEL CDlinux KERNEL /boot/cdlinux/bzImage quiet APPEND initrd=/boot/cdlinux/initrd LABEL slitaz MENU LABEL Slitaz KERNEL /boot/slitaz/bzImage rw root/dev/null vga=normal APPEND initrd=/boot/slitaz/rootfs.gz LABEL dsl MENU LABEL Damn Small Linux #uncomment the below line for liveCD KERNEL /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 knoppix_dir=dsl nomce noapic quiet BOOT_IMAGE=knoppix #uncomment the below line for liveUSB # KERNEL /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 knoppix_dir=dsl nomce noapic fromhd quiet BOOT_IMAGE=knoppix APPEND initrd=/boot/dsl/minirt24.gz LABEL geexbox MENU LABEL GeeXBoX #uncomment the below line for liveCD KERNEL /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc boot=cdrom lang=en remote=atiusb receiver=atiusb keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet #uncomment the below line for liveUSB and replace the UUID value with your device UUID # KERNEL /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc boot=UUID=0196-F5B5 lang=en remote=atiusb receiver=atiusb keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet APPEND initrd=/boot/geexbox/initrd.gz LABEL goblinx MENU LABEL GoblinX Linux KERNEL /boot/goblinx/vmlinuz vga=791 ramdisk_size=6666 root=/dev/ram0 rw load=Muser locale=english splash=silent changes=/goblinx/ run.f APPEND initrd=/boot/goblinx/initrd.gz
Now copy the JPEG image, say splash.jpg, to mbcd/boot/isolinux/
. SYSLINUX can load JPEG images directly without any modification (with the help of the vesamenu.c32
module).
$ cp splash.jpg mbcd/boot/isolinux
If you decide not to include the vesamenu.c32
module, you can always have a text menu. Without this vesamenu.c32
module, the ‘MENU’ keywords will not be recognised and therefore no graphical menu will be displayed. It will show an error and fall back to text mode showing a boot:
prompt asking for an OS label. Enter the label of the OS (beside the ‘LABEL’ field) that you want to boot and press Enter.
To avoid memorising the label names, write a plain text file containing the OS name list and their corresponding label names and save it inside mbcd/boot/isolinux/
as list.msg
. It is printed on the screen at boot time by DISPLAY list.msg
. The line ‘F1 list.msg’ displays the ‘list.msg’ file whenever you press F1.
An example of list.msg
follows:
To boot the Operating System type in the keyword in the prompt and press enter =============================== Operating System Name Keyword ——————————————— Austrumi Linux austrumi Puppy Linux puppy CDlinux cdlinux Slitaz slitaz Damn Small Linux dsl GeeXboX geexbox GoblinX goblinx ————————————————
[3] Configuration changes for the live USB
In Phase VI we will describe how to make a bootable live USB with SYSLINUX and Grub. If you are creating a multi-boot live USB, only then make the following changes to the configuration file (Grub or SYSLINUX).
For Austrumi: replace ‘dolivecd’ with ‘dousb’ and for Puppy, replace ‘pmedia=cd’ with ‘pmedia=usbflash’. For DSL, append the ‘fromhd’ boot parameter in the kernel line. For GeeXBox, you need to specify the UUID of your USB device. To get the UUID of your USB partition, execute the following:
# blkid /dev/sdXy
…after replacing /dev/sdXy
with the appropriate device name in your case, and noting down the value of the UUID field. In my case, the command was blkid /dev/sdb1
and the UUID was 0196-F5B5. Now pass the UUID by appending the following to the kernel line:
'boot=UUID=<your_uuid>'
The configuration files contain the live USB lines (commented). So, comment the lines for the live CD and uncomment the lines for the live USB to get the desired changes.
Phase V: Making the ISO image
Recheck the mbcd/
for errors—check if all the paths to the configuration files are valid, whether all the files are copied, unnecessary back-up files ending with tilde have been removed “~”, etc.
We will use mkisofs
to make the ISO image. Run the following command if you are making a Grub bootable image.
$ mkisofs -iso-level 3 -R -J —input-charset=utf8 -b boot/grub/stage2_eltorito -c boot/boot.catalog -no-emul-boot -boot-load-size 4 -boot-info-table -o mbcd.iso mbcd
If you want to make the ISO image boot with ISOLINUX instead, point to the isolinux.bin
boot image:
$ mkisofs -iso-level 3 -R -J —input-charset=utf8 -b boot/isolinux/isolinux.bin -c boot/boot.catalog -no-emul-boot -boot-load-size 4 -boot-info-table -o mbcd.iso mbcd
Now burn it into a CD-R.
Tip: Test the ISO file in a virtual machine before you burn a CD.
Phase VI: Making the Swiss knife
Now it’s time to convert your USB Flash drive to a GNU/Linux-powered, home-made Swiss knife with seven flavours.
We will describe how to make your USB drive bootable with both SYSLINUX and Grub. Though this process is not destructive, it is always advisable to back up data (see ‘Notes on USB Booting’). First copy all the contents of work_dir/mbcd/
into the USB drive partition:
$ cp -r mbcd/* /media/disk/
Then install the Grub or SYSLINUX bootloader and set the boot flag.
[1] Installing SYSLINUX
In the USB drive, rename the directory isolinux/
to syslinux/
, rename isolinux.cfg
to syslinux.cfg
and isolinux.bin
to syslinux.bin
. Assuming your USB drive is mounted in /media/disk
, execute:
$ mv /media/disk/boot/isolinux /media/disk/boot/syslinux $ mv /media/disk/boot/syslinux/isolinux.cfg /media/disk/boot/syslinux/syslinux.cfg $ mv /media/disk/boot/syslinux/isolinux.bin /media/disk/boot/syslinux/syslinux.bin
Now install SYSLINUX in the USB drive’s partition where you have the boot directory:
# syslinux -sd boot/syslinux /dev/sdXy
If the USB drive partition that has the bootloader is /dev/sdb1
, then the above command would be:
# syslinux -ds boot/syslinux/ /dev/sdb1
This will alter the MBR (Master Boot Record) by installing the boot code and installing ldlinux.sys
in the partition.
[2] Installing Grub
The grub-install
shell script will be used to do this job. The following command installs Grub in both the MBR and the partition.
# grub-install --root-directory=/media/disk /dev/sdX
The /media/disk/
directory should point to the mount point of your USB partition. This will install the boot code in the MBR and install Stage1.5 and Stage 2 into the partition and set the configuration file.
Note: Use the Grub shell for better control.
[3] Set the boot flag
Unmount the USB partition and make it bootable by setting the boot flag with parted
, fdisk
or any partition manager.
# umount /dev/sdXy # parted /dev/sdX set y boot on
For example, if your USB drive partition is /dev/sdb1
(containing the boot directory), then the above commands would be:
# umount /dev/sdb1 # parted /dev/sdb set 1 boot on
After you have installed either Grub or SYSLINUX, make the changes in the configuration file as described in Phase IV, Section [3].
Phase VII: Cleaning up
Finally, we’ll need to clean up the mess we’ve created. Notice that the working directory has grown to a huge size, because you have three copies of each OS in it (the original ISO, the extracted files, and the files inside the mbcd.iso
). We will dispose of the work_dir/
, excluding mbcd.iso
(obviously).
$ mv mbcd.iso .. $ cd .. # rm -rI work_dir # umount /mnt/tmp? # rmdir /mnt/tmp?
To add, modify or change the mbcd image, you do not need to mount all those distros again; just extract mbcd.iso
, make edits, and repack it to an ISO, or use ISOmaster.
Adding more than one Knoppix-based distro
All Knoppix-based live distros have a compressed filesystem, the cloop file, in the same location—KNOPPIX/KNOPPIX
. So no more than one Knoppix-based distro can reside in a media. To keep more than one of these, the cloop files of the second distro should be kept in different directories or have different names. After you change the cloop file’s path, you need to pass it with the boot parameters shown below:
knoppix_dir=<path to dir containing the cloop file with leading "/"> knoppix_name=<name of the cloop file>
For example, we have kept the DSL cloop file in the dsl/
directory, so we have passed knoppix_dir=dsl/
. If the name of the cloop file is changed, then you also need to append “knoppix_name=newname” as the kernel parameter. An example for Grub is shown below. It’s recommended to change only directories.
kernel /boot/dsl/linux24 knoppix_dir=dsl/ knoppix_name=newname
Notes on USB booting
To boot from a USB drive, you need to plug it in and make sure that your system supports booting from a USB drive. Consult your motherboard manual to change the boot order.
The Master Boot Record or the boot sector consists of 512 bytes and it resides at the beginning of the disk—the first sector. The first 446 bytes is reserved for the boot code. The boot code needs to be installed in order to make the BIOS boot from this drive. The next 64 bytes contain the partition table. Each partition is described with 16 bytes, so the disk can contain four primary partitions. The last two bytes contain the signature.
SYSLINUX supplies a sample MBR, the mbr.bin file, which can be used to overwrite the MBR boot code. To do this, first locate mbr.bin
in your system and execute the following:
# dd if=/path/to/mbr.bin of=/dev/sdX
To clear the boot code section of MBR, execute the following command:
# dd if=/dev/zero of=/dev/sdX bs=440 count=1
Note that we didn’t clear the whole 446 bytes here. This is because byte number 441 to 444 are used to store disk signatures, and the remaining two bytes are kept empty. For more information visit en.wikipedia.org/wiki/Master_boot_record.
It is recommended to back up your boot sector along with your files before making the USB bootable. To back up the boot sector, execute the following:
# dd if=/dev/sdX of=usb_mbr_bak bs=512 count=1
To restore the MBR, execute:
# dd if=usb_mbr_bak of=/dev/sdX
A multi-booting media is always intriguing, especially when it has a collection of great mini distros. Now that we have booted a CD/DVD and a USB drive, why don’t we do the same with an internal HDD. This can be done exactly as we did for the USB drive. Keep the OS files in the root of a drive and make sure all the locations are correct in the config file; then make the HDD bootable with Grub or SYSLINUX. Next, load the config file from the menu; if Grub or SYSLINUX is already installed, then this is done—you just need to call the configuration file with the configfile command from the Grub shell.
Note: Please play safe, because sometimes you only come to know you’ve lost something important when you restart your system the next morning.
[…] SYSLINUX man pages First Publish Information : This article was first published on Linux For You (LFY), August 2009 Issue, under Creative Commons Licence. Link: https://www.opensourceforu.com/how-to/create-multiboot-discs/ […]
It s very interesting to know ,thanks
Thanks man, just what I was looking for. Worked like a charm Thanks so much…
thank you very much!
Thanks man, just what I was looking for. Thanks so much…
I wanna make multi-boot dvd which includes ubuntu 32bit, 64bit, server edition, puppy and knoppix all in a single DVD. At boot time, it will give me a menu to choose which one to install. How can I do this on a windows machine?
Interesting alternative to xboot
some command lines and that’s all…
That’s linux power !!!
Interesting but very confusing. From the outset it appears the there is a mistake with reference to work_dir followed by a reference to word_dir. That needs to be explained.
A further question arises as to whether we are assembling all these folders & files on the hdd ready to burn to the cd/dvd or whether we’re directly addressing the cd/dvd drive itself. That needs to be explained.
The statement in Phase V ‘Now burn it into a CD-R.’ needs to be replaced with the actual commands required to burn the result to a cd/dvd.
Allen
Oz