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

Gene Cumm gene.cumm at gmail.com
Fri Jan 28 19:29:43 PST 2011


On Fri, Jan 28, 2011 at 20:33, Martin T <m4rtntns at gmail.com> wrote:
> I would like to boot Ubuntu 8.04 i386 from my USB flash drive. I was
> guided by this tutorial:
> http://syslinux.zytor.com/wiki/index.php/HowTos#How_to_Create_a_Bootable_USB:_For_Linux

1) Are you looking to boot Ubuntu Live from your USB drive as opposed
to burning the ISO to a CD and booting the CD?  I believe UNetBootIn (
http://unetbootin.sourceforge.net/ ) would provide an easier way to
accomplish this.  I've used this several times for creating bootable
USB flash drives.

2) Any reason to not use the current release (10.10) or current LTS
release (10.04.1)?

> I took following steps:
>
> 1) made sure that usb_storage.ko kernel module is loaded

> 2) inserted USB flash drive

> 3) zero-filled my 8GB Sony flash drive(/dev/sdb)

A little extreme but everyone has their habits.  I like using
"conv=notrunc" consistently with dd as I work with disk image files
that could otherwise be truncated undesirably.

> 4) made partition table to MBR of /dev/sdb

> 5) set FAT32 partition to /dev/sdb1

> 6) copied MBR code area

> 7) mount USB flash drive and download Ubuntu 8.04
>
> root at martin-desktop:~# mount /dev/sdb1 /media/ -t vfat

> root at martin-desktop:~# ls -lsh /media/
> total 700M
> 700M -rwxr-xr-x 1 root root 700M 2010-01-21 12:19 ubuntu-8.04.4-desktop-i386.iso

It is normally suggested (just as good habit; not related to your
issues) to verify your download, ie check md5, sha1, sha256 and/or a
cryptographic signature.  Ubuntu provides MD5SUMS, SHA1SUMS and
SHA256SUMS along with a .gpg signature file that allows you to even
verify the authenticity of the checksum files.

> 8) mount Ubuntu .iso as a loop device to /mnt

> 9) copy vmlinuz and initrd to flash drive

> root at martin-desktop:~# ls -lh /media/
> total 710M
> -rwxr-xr-x 1 root root 7.5M 2011-01-29 03:11 initrd.gz
> -rwxr-xr-x 1 root root 700M 2010-01-21 12:19 ubuntu-8.04.4-desktop-i386.iso
> -rwxr-xr-x 1 root root 1.9M 2011-01-29 03:11 vmlinuz

> 10) create /media/syslinux.cfg file
>
> root at martin-desktop:~# printf "default vmlinuz\nappend
> initrd=initrd.gz\n" > /media/syslinux.cfg

> 11) umount /mnt(.iso loop device) and /media(USB flash drive)

> 12) install syslinux to /dev/sdb1
>
> root at martin-desktop:~# syslinux -s /dev/sdb1

Must be a 3.xx variant.  Distribution packages are convenient but
upstream is a lot more up to date and ready to go (pre-compiled) for
most.  (See also
http://syslinux.zytor.com/wiki/index.php/Common_Problems#Official_Binaries
)

> 13) mount /dev/sdb1 once more in order to be sure, that all the
> necessary files are on the flash drive

Definitely a good habit as it shows that something desirable probably happened.

If you're really paranoid, perform the normal umount/eject procedures,
wait a few seconds after last visible activity (prompt returns, GUI
acknowledges, and flash drive activity light blinks) then physically
remove the drive then re-insert it and mount it.

> When I set "USB flash drive" as a first bootable device in BIOS, I get
> SYSLINUX "boot:" prompt and it loads both "vmlinuz" and "initrd.gz",
> but finally I end up in BusyBox prompt and following message:
>
> "Check root= bootarg cat /proc/cmdline or missing
> modules, devices: cat /proc/modules ls /dev
> ALERT! does not exist. Dropping to a shell!"
>
> Last boot message which I see is "Attached scsi generic sg2 type 0".
>
>
> Any suggestions, what might cause such behavior? Did I miss anything
> while preparing USB flash drive? Let me know if additional information
> is needed. All longer explanations are most welcome :)

The behavior you're seeing is that it doesn't know where else to go
from there.  All it has is a kernel and basic initrd.  It hasn't been
instructed where to go to continue on.  Again, I'd suggest UNetBootIn,
unless you're prepared to do everything it does but on your own
(probably a bit of work).

-- 
-Gene




More information about the Syslinux mailing list