[syslinux] How to make a bootable USB flash drive manually?

Martin T m4rtntns at gmail.com
Sun Jan 30 16:02:06 PST 2011


Ok, I see. However, I modified my syslinux.cfg file a bit in order to
boot multiple images from USB flash drive. So currently my SYSLINUX
partition has following files(I would like to boot Ubuntu 10.10, BT4,
Puppy-Linux, memtest86 and memtest86+):

root at martin-desktop:/# ls -lh /media/bootableimg/
total 2.8G
-rwxr-xr-x 1 martin martin 1.9G 2011-01-30 23:36 bt4-r2.iso
-rwxr-xr-x 1 martin martin 4.7M 2011-01-31 01:06 bt-vmlinuz
-rwxr-xr-x 1 martin martin  33M 2011-01-31 01:06 initrd.gz
-rwxr-xr-x 1 martin martin  11M 2011-01-31 00:09 initrd.lz
-r-xr-xr-x 1 martin martin  15K 2011-01-31 00:22 ldlinux.sys
-rwxr-xr-x 1 martin martin 127M 2011-01-30 23:41 lupu-520.iso
-rwxr-xr-x 1 martin martin 122K 2011-01-30 23:43 memtest86
-rwxr-xr-x 1 martin martin 161K 2011-01-30 23:43 memtest86plus
-rwxr-xr-x 1 martin martin  54K 2011-01-31 00:05 menu.c32
-rwxr-xr-x 1 martin martin 1.8M 2011-01-31 01:41 puppy-initrd.gz
-rwxr-xr-x 1 martin martin 2.2M 2011-01-31 01:40 puppy-vmlinuz
-rwxr-xr-x 1 martin martin  610 2011-01-31 01:48 syslinux.cfg
-rwxr-xr-x 1 martin martin 694M 2011-01-30 23:40 ubuntu-10.10-desktop-i386.iso
-rwxr-xr-x 1 martin martin 4.1M 2011-01-31 01:09 ubuntu-vmlinuz
root at martin-desktop:/#

..and syslinux.cfg is following:

root at martin-desktop:/# cat /media/bootableimg/syslinux.cfg
DEFAULT menu.c32
PROMPT 0
MENU TITLE bootableimg

TIMEOUT 300

LABEL ubuntu
MENU default
MENU LABEL Ubuntu 10.10 desktop i386 32bit
LINUX ubuntu-vmlinuz
APPEND initrd=initrd.lz boot=casper
iso-scan/filename=/ubuntu-10.10-desktop-i386.iso

LABEL bt
MENU LABEL BackTrack 4 R2
LINUX bt-vmlinuz
APPEND initrd=initrd.gz boot=casper iso-scan/filename=/bt4-r2.iso

LABEL puppy
MENU LABEL Puppy Linux 5.2
LINUX puppy-vmlinuz
APPEND initrd=puppy-initrd.gz iso-scan/filename=/lupu-520.iso

LABEL memtest86
MENU LABEL memtest86 v3.5a
LINUX memtest86

LABEL memtest86plus
MENU LABEL memtest86+ v4.20
LINUX memtest86plus


root at martin-desktop:/#


The problem is, that if I boot from USB flash drive, it boots into
SYSLINUX menu.c32 and I'm able to choose between "MENU LABEL" -s using
up and down arrow keys, but if I push ENTER, nothing happens. This
applies to all menu entries. If I press TAB key on every "MENU LABEL",
then entries are following:

> .linux ubuntu-vmlinuz initrd=initrd.lz boot=casper iso-scan/filename=/ubuntu-10.10-desktop-i386.iso
> .linux bt-vmlinuz initrd=initrd.gz boot=casper iso-scan/filename=/bt4-r2.iso
> .linux puppy-vmlinuz initrd=puppy-initrd.gz iso-scan/filename=/lupu-520.iso
> .linux memtest86
> .linux memtest86plus

I tried to remove ".linux" part and tested for example with
".memtest86", but I was still unable to boot any of the menu entries.
Any ideas, what causes this?


thank you in advance,
Martin


2011/1/29 Gene Cumm <gene.cumm at gmail.com>:
> On Sat, Jan 29, 2011 at 13:00, Martin T <m4rtntns at gmail.com> wrote:
>> Gene Cumm, Paul Bolle and Gert Hulselmans thank you for replies!
>>
>> At first I would like to boot from .iso. As I use SYSLINUX 3.63,
>> according to this
>> document(http://syslinux.zytor.com/wiki/index.php/SYSLINUX#INITRD_initrd_file),
>> "INITRD" statement does not work(just to be sure I tried this and
>> indeed initrd.gz did not load). However, it shouldn't harm if location
>> of initrd.gz is specified using initrd=initrd.gz under APPEND.
>>
>> I tried with following:
>>
>> root at martin-desktop:~# cat /media/ubuntu/syslinux.cfg
>> DEFAULT ubuntu
>>
>> LABEL ubuntu
>> LINUX vmlinuz
>> APPEND initrd=initrd.gz boot=casper
>> iso-scan/filename=/ubuntu-8.04.4-desktop-i386.iso
>> root at martin-desktop:~#
>>
>> ..and it loaded to Ubuntu! Basically problem is solved now. However, I
>> tried to simplify configuration of syslinux.cfg and ended up with
>> this:
>>
>> root at martin-desktop:~# cat /media/ubuntu/syslinux.cfg
>> DEFAULT vmlinuz
>> APPEND initrd=initrd.gz boot=casper
>> iso-scan/filename=/ubuntu-8.04.4-desktop-i386.iso
>> root at martin-desktop:~#
>>
>> This works as well. As I understand, DEFAULT points to executable
>> kernel image(vmlinuz) and APPEND adds parameters to kernel: "initrd="
>> points to initial ramdisk and "iso-scan/filename=" teaches Ubuntu
>> distribution, that it should load from .iso image. Am I correct, that
>> booting from .iso image needs to be supported by distribution boot
>> scripts? In other words "iso-scan/filename=" might not always work? In
>> addition, what does "boot=casper" do?
>
> This config could be acceptable if that's the only thing you ever want
> to use this USB flash drive for which is why I'd recommend the
> previous config over the new one.  Both are under 512 bytes.  Both
> would have the same disk I/O requirement and the processing difference
> is indistinguishable to a human.
>
> What this means is the global DEFAULT KERNEL/LABEL is "vmlinuz" and
> the global APPEND is added to all commands that are executed.
>
> --
> -Gene
>
>> 2011/1/29 Gert Hulselmans <gerth at zytor.com>:
>>> Martin T wrote:
>>>> 10) create /media/syslinux.cfg file
>>>>
>>>> root at martin-desktop:~# printf "default vmlinuz\nappend
>>>> initrd=initrd.gz\n" > /media/syslinux.cfg
>>>> root at martin-desktop:~#
>>>>
>>> Your syslinux.cfg file is wrong when you want to do boot from the ISO.
>>>
>>> Use this:
>>> ========================================
>>> DEFAULT ubuntu
>>>
>>> LABEL ubuntu
>>> LINUX /vmlinuz
>>> INITRD /initrd.gz
>>> APPEND boot=casper iso-scan/filename=/ubuntu-8.04.4-desktop-i386.iso
>>> ========================================
>>>
>>> - Gert Hulselmans
>
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>




More information about the Syslinux mailing list