Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Search this Thread
Old 04-01-2010, 08:58 AM   #1
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Rep: Reputation: 19
GRUB: Booting from USB; Creating the Ultimate Bootable USB Stick

Ok, so last week I was sick for a few days, and spent my down time working on creating a bootable USB flash drive with GRUB on it. Most everything is working great, but there's a few things I haven't figured out yet. To start out, here's my menu.lst:
title		Memtest86+ 4.00
kernel		/os/memtest/memtest86+-4.00.bin

title		Debian 5.0.4 i386 Installation
root		(hd0,0)
kernel		/os/debian/install.386/vmlinuz
initrd		/os/debian/install.386/initrd.gz

title		Gparted - Partition Editor
root		(hd0,0)
kernel		/os/gparted/live/vmlinuz1
initrd		/os/gparted/live/initrd1.img

title		Debian Live - Old ver (3.1 R8)
root		(hd0,0)
kernel		/os/debianliveold/install/vmlinuz
initrd		/os/debianliveold/install/initrd.gz

title		Debian Live - 5.0.4 i386 Gnome (from .img file)
root		(hd0,0)
kernel		/syslinux-3.85/memdisk/memdisk
initrd		/os/debianlive/debian-live-504-i386-gnome-desktop.img

title		Debian Live - 5.0.2 i386 Gnome
root		(hd0,0)
kernel		/os/debianlive/live/vmlinuz1 root=/dev/sda1
initrd		/os/debianlive/live/initrd1.img

title		Debian Lenny - Netinstall
root		(hd0,0)
kernel		/os/billix/lenny
initrd		/os/billix/lenny.img

title		Debian Etch - Netinstall
root		(hd0,0)
kernel		/os/billix/etch
initrd		/os/billix/etch.gz

title		CentOS 4.7 - Netinstall
root		(hd0,0)
kernel		/os/billix/centos
initrd		/os/billix/centos.img

title		CentOS 5.2 - Netinstall
root		(hd0,0)
kernel		/os/billix/centos5
initrd		/os/billix/centos5.img

title		DBAN - Darik's Boot and Nuke
root		(hd0,0)
kernel		/os/billix/dban
initrd		/os/billix/dban.bzi

title		DSL
root		(hd0,0)
kernel		/os/billix/linux24
initrd		/os/billix/DSL/KNOPPIX

title		Fedora 10 Netinstall
root		(hd0,0)
kernel		/os/billix/fedora
initrd		/os/billix/initrdf.img

title		Ubuntu Linux - Hardy Heron Desktop (8.04LTS)
root		(hd0,0)
kernel		/os/billix/hardy
initrd		/os/billix/hardy.gz

title		Ubuntu Linux - Intrepid Ibex Desktop (8.10LTS)
root		(hd0,0)
kernel		/os/billix/intrepid
initrd		/os/billix/intrepid.gz

title		Ubuntu Linux - Jaunty Jackalope Desktop (9.04)
root		(hd0,0)
kernel		/os/billix/jaunty
initrd		/os/billix/jaunty.gz

#NOTE: XP Install/Recovery Console are on a second FAT32 partition

title		Windows XP Pro SP2 Install
root		(hd0,1)/os/windows/xp/
chainloader +1

title		Windows XP Recovery Console
root		(hd0,1)/os/windows/xp_recovery_console/
chainloader +1

title		Windows Password Cracker
root		(hd0,0)
kernel		/os/billix/ntpwd
initrd		/os/billix/initrdnt.gz
(Yes, I cheated and got the netinstalls from the Billix .iso .)

Now, here's the ones that don't work:
ALL Debian LiveCDs
Win XP Pro Installer
Win XP Recovery Console

Gparted and the Debian LiveCDs are the most important; I haven't tried to get the windows stuff working yet (I just guessed at what those entries should look like).

Anything obvious I'm missing? It seems to be only the LiveCDs I'm having trouble with... I'll report the exact error messages later. (I know the kernel/initrd paths are correct; I get errors from Linux during startup.)

Also, any more knowledge about GRUB in general is much appreciated; I'm aware I may have extra "root (hd0,0)" lines etc. in there.

Last edited by Jinouchi; 04-01-2010 at 09:03 AM.
Old 04-01-2010, 09:36 AM   #2
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336

a couple pointers

1) you cant "hide" the debian live stuff inder alot of folders
the initrd gos looking for a folder named "live"

You should therefore edit the initrd for each debian based system
it's pretty easy

Basically, create a folder named "tree", cd into folder tree and open the initrd with cpio

assuming initrd.gz is in folder with tree folder
mkdir tree
cd tree

zcat ../initrd.gz | cpio -i -d
now, the initrd is uncompressed in tree folder
look in folder scripts and open the script "live" as root with text editor
it looks like this, just the top part

# set -e

export PATH="/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin:/bin:/sbin"

echo "/root/lib" >> /etc/
echo "/root/usr/lib" >> /etc/


editable parts are LIVE_MEDIA_PATH="live" and

dont change the mountpoint (mountpoint="/live/image")

you need to make each LIVE_MEDIA_PATH= different for debian live and gparted

so, for example; change the older debian live path to

and new to

if running persistent you also need to change the live-rw to whatever

I never use these
you can use any names you want, just dont make them very long

to edit the other initrds just make them .gz's instead of .img

mv initrd1.img initrd.gz
then do the above to them

so, your new grub menu.lst may be like

title		Gparted - Partition Editor
root		(hd0,0)
kernel		/gparted/vmlinuz1
initrd		/gparted/initrd1.img

title		Debian Live - Old ver (3.1 R8)
root		(hd0,0)
kernel		/os/debianliveold/install/vmlinuz
initrd		/os/debianliveold/install/initrd.gz

title		Debian Live - 5.0.4 i386 Gnome (from .img file)
root		(hd0,0)
kernel		/syslinux-3.85/memdisk/memdisk
initrd		/new/debian-live-504-i386-gnome-desktop.img

title		Debian Live - 5.0.2 i386 Gnome
root		(hd0,0)
kernel		/502/vmlinuz1 root=/dev/sda1
initrd		/502/initrd1.img
you also need to put proper kernel line boot parameters
see here
Boot Parameters for Debian Live

Updated for live-initramfs 1.156.1-1 on 2009-02-08.

These options (can be combined) work from the bootloader prompt:

live access=ACCESS
live console=TTY,SPEED
live debug
live fetch=URL
live hostname=HOSTNAME
live username=USER
live userfullname=USERFULLNAME
live integrity-check
live ip[=frommedia]
live {keyb|kbd-chooser/method}=KEYBOARD
live {klayout|console-setup/layoutcode}=LAYOUT
live {kvariant|console-setup/variantcode}=VARIANT
live {kmodel|console-setup/modelcode}=CODE
live koptions=OPTIONS
live live-getty
live {live-media|bootfrom}=DEVICE
live {live-media-encryption|encryption}=TYPE
live live-media-offset=BYTES
live live-media-path=PATH
live live-media-timeout=SECONDS
live {locale|debian-installer/locale}=LOCALE
live module=NAME
live netboot[=nfs|cifs]
live nfsopts=
live noautologin
live noxautologin
live nofastboot
live nopersistent
live nosudo
live swapon
live nouser
live noxautoconfig
live persistent[=nofiles]
live persistent-path=PATH
live {preseed/file|file}=FILE
live package/question=VALUE
live quickreboot
live showmounts
live timezone=TIMEZONE
live todisk=DEVICE
live toram
live union=aufs|unionfs
live utc=yes|no
live xdebconf
live xvideomode=RESOLUTION

Values for the vga kernel parameter:

Colours 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
4 bits | ? ? 0x302 ? ? ? ?
8 bits | 0x300 0x301 0x303 0x305 0x161 0x307 0x31C
15 bits | ? 0x310 0x313 0x316 0x162 0x319 0x31D
16 bits | ? 0x311 0x314 0x317 0x163 0x31A 0x31E
24 bits | ? 0x312 0x315 0x318 ? 0x31B 0x31F
32 bits | ? ? ? ? 0x164 ?

Colours 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
4 bits | ? ? 770 ? ? ? ?
8 bits | 768 769 771 773 353 775 796
15 bits | ? 784 787 790 354 793 797
16 bits | ? 758 788 791 355 794 798
24 bits | ? 786 789 792 ? 795 799
32 bits | ? ? ? ? 356 ?
and heres the debian live persistence stuff

so, check that out and see if you have any more issues
Old 04-07-2010, 04:17 PM   #3
Registered: Jul 2007
Location: WI, USA
Distribution: Debian, Lenny
Posts: 111

Original Poster
Rep: Reputation: 19
Wow, I envy your level of understanding!

Well, so far I've managed to get that far, I've edited the live script with the correct path. Now instead of being dumped into a shell, I get a kernel panic and no init found. I have a hunch that it may have something to do with the filesystem.squashfs, but that's just me. I've spent hours working on this but haven't been able to get any further. I noticed there's a 'run-init' file in /bin, and tried using init=/bin/run-init, as well as several other things, but that didn't work either. What's the next step?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a USB stick bootable from a bootable cdrom cwwilson721 Slackware 2 10-23-2009 09:18 PM
creating a bootable WinXP USB stick in Fedora 10 manuleka Linux - Software 1 05-17-2009 10:47 PM
may install from cdrom to USB FLASH DRIVE(to get it a USB stick bootable) the ubuntu lse123 Linux - Newbie 5 01-02-2009 04:56 PM
Booting Ubuntu LiveCD from USB Stick using GRUB as the bootloader retrovertigo Ubuntu 0 08-30-2008 09:45 PM
Boot from USB stick if no booting USB in Bios 1kyle Suse/Novell 1 03-26-2007 12:24 AM

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration