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

Gene Cumm gene.cumm at gmail.com
Sun Jan 30 18:02:14 PST 2011


On Sun, Jan 30, 2011 at 19:02, Martin T <m4rtntns at gmail.com> wrote:
> 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

Aside from the fact that UI was introduced in a later version, your
config is reasonable.  If you upgrade to 3.74+, you can use UI and set
a different DEFAULT (like "DEFAULT ubuntu") such that it'll be the
default if you're at a "boot: " prompt or don't use MENU DEFAULT.

> 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?

http://syslinux.zytor.com/wiki/index.php/Common_Problems#What.27s_the_real_name_of_that_file.3F

You're below 3.70.  Upgrade or change all of your filenames to fit DOS
8.3 conventions.  I'd recommend upgrading to 4.03.

-- 
-Gene

> 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




More information about the Syslinux mailing list