LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-03-2008, 10:05 PM   #1
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 65
Booting a usb pen drive from lilo


I know it SHOULD be easy.

Here's my config:
Code:
/dev/hda1 Windows
/dev/hdb1 Slackware
/dev/hdb2 Linux Swap
Now I have a pen drive, it always gets put into /dev/sda, and is formatted as a Fat16 drive (sda1)
I installed Slax on it from their "Slax for USB".

Due to older hardware limitations, I cannot boot direct from this drive.

However, I SHOULD be able to boot to it using lilo, right?

So far, miserable failure.
Here is my lilo.conf (Works fine dual booting XP/Slackware) :
Code:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
lba32 # Allow booting past 1024th cylinder with a recent BIOS
boot = /dev/hda
compact # faster, but won't work on all systems.
prompt
timeout = 50
# VESA framebuffer console @ 1024x768x64k
vga = 791
# End LILO global section
# Windows bootable partition config begins
other = /dev/hda1
label = Windows
table = /dev/hda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
initrd = /boot/initrd.gz
root = /dev/hdb1
label = Slackware
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
I've tried to mount it as a Linux partion using liloconfig. (Nope. Just NOTHING happens when I select it at the menu)

I've tried as a Windows/DOS partition (Same results)

Ideas?
 
Old 09-04-2008, 02:09 AM   #2
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
hello cwwilson,
i hope this method should work,(i have never tried )

copy the first few sector of usb to ur hard disk, ask lilo to load that image(use dd to copy the image)
for eg. copy the image of usb disk to the /boot by
Code:
# dd if=/dev/sda of=/boot/usb.image bs=446 count=1
and put an entry in lilo to point to this image.

i hope it should work
best of luck and please reply if it works

hope u were on a long vacation (no posts for a long time )
regards rkrishna
 
Old 09-04-2008, 02:56 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Since your BIOS won't boot from USB, you need to put your kernel and initrd for the USB drive along side your regular kernels. If your kernel doesn't include the necessary USB features, you'll have to use an initrd which loads the modules. You'll need to pass the 'rootdelay' option also -even if the kernel includes USB support, the drivers don't finish initializing before lilo tries to mount /. the rootdelay(usually 5-15 seconds works) tells the kernel to wait before trying to mount root.
 
Old 09-04-2008, 05:09 PM   #4
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 65
Quote:
Originally Posted by gnashley View Post
Since your BIOS won't boot from USB, you need to put your kernel and initrd for the USB drive along side your regular kernels. If your kernel doesn't include the necessary USB features, you'll have to use an initrd which loads the modules. You'll need to pass the 'rootdelay' option also -even if the kernel includes USB support, the drivers don't finish initializing before lilo tries to mount /. the rootdelay(usually 5-15 seconds works) tells the kernel to wait before trying to mount root.
I figure you mean to put the vmlinuz and initrd.gz from the pen drive to /boot of my Slackware disk, correct?

And, then, add a lilo section to point to these? With "append = rootdelay 10" and "root = /dev/sda1"?
 
Old 09-05-2008, 01:53 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
That's right. That should get you going. You can also create a bootable CD with those items(using mkrescue) and be able to use your USB stick on other machines which can't boot USB from BIOS. You can use syslinux to make the USB drive bootable itself in order to be able to boot it directly on machines whih allow booting USB from BIOS. Of course, you can use lilo or grub or syslinux for all the above -your choice.
 
Old 09-07-2008, 02:14 PM   #6
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 65
Already have a bootable CD with Slax on it.

And by trying your suggestion, it STARTED to boot, but when it got to the "Switching Device" part (I'm assuming the '/' for the usb), it locks up....

Oh, well, I'm getting closer...
 
Old 09-08-2008, 02:06 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Are you using the rootdelay option in the kernel commandline? Please post your new lilo.conf file

Last edited by gnashley; 09-08-2008 at 02:46 AM.
 
Old 09-08-2008, 07:58 AM   #8
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
assuming your bios can boot from usb?

I have successfully made a bootable slax for usb using grub.
If the first assumption is true, I can give you a step by step guide.

Otherwise what you are supposed to dowload the slax for usb and unpack it then write /boot and /slax to usb then

Code:
su
cd /pathway to usb/boot
sh liloinst.sh
(follow instructions)

pathway may be /media/disk or /mnt/usb or whatever.

2) Either take a punt and reboot to test or run a dd command to test lilo is in mbr of stick

dd if=/devsdX bs=512 count=1 (output goes to screen)

where sdX is sda or sdb etc depending on where stick is mounted
 
Old 09-08-2008, 08:46 AM   #9
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,445

Rep: Reputation: 94
use bs=446 to copy bootloader bytes, else you copy also the partition table
http://en.wikipedia.org/wiki/Master_boot_record
 
Old 09-08-2008, 08:57 AM   #10
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Original Poster
Rep: Reputation: 65
Quote:
Originally Posted by aus9 View Post
assuming your bios can boot from usb?
Not a bootable USB bios (As stated in my first post).

I'll post my new lilo.conf as soon as I get to my linux box.

Thanks
 
Old 09-08-2008, 11:29 AM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
I use grub, but I think your entry should look about like this:

# Linux bootable partition config begins
image = /boot/vmlinuz-for-usb
initrd = /boot/initrd.gz-for-usb
root = /dev/sda1
append = rootdelay=10
label = Slackware
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

If the installation matches the version on your hard disk you could even use the same kernel as for the HD, but adjust the name of the kernel and initrd.gz if they are different than for HD. If you have hard-linked all the necessary filesystem, USB and SCSI stuff into the kernel you don't need an initrd at all.

My entry using grub looks like this:

#1 Linux bootable partition config begins
title Slack-11.0 bootsplash on (/dev/hdb3) GUI Login rootdelay
kernel (hd0,0)/vmlinuz-2.4.35.1-rootdelay root=/dev/hdb3 ro rootdelay=20 vga=791 ide0=ata66 hdd=ide-scsi
initrd (hd0,0)/initrd
# Linux bootable partition config ends

You may notice that this is for a 2.4 kernel which didn't used to support the rootdelay feature. But it will staring with 2.4.37 as my patch has been accepted into the main kernel tree. I'm not sure when this feature first made it into the 2.6 kernel, but I'm sure that anything later than 2.6.15 will have it.

I'll explain a little more about why you need this option. Even if you have the USB drivers hard-linked in your kernel, the drivers are pretty slow to register. Normally, the kernel finishes decompressing itself and already tries to mount / before the USB drivers are ready. The rootdelay option tells the kernel to delay the given time before trying mount /. If the USB device has more than one partition you may need to allow even more time. A 512MB FLASH with a single partition might only need 3 seconds or less. But a 7 partition 40GB USB *harddrive* might need 15-20 seconds. The amount of time needed could eadily vary bewteen 1 second and 30 seconds. You can also create an initrd which includes a 'sleep' command, but using rootdelay is handier.
 
  


Reply


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
USB Pen Drive / Flash Drive Unmounted but the power is there teluguswan Linux - Hardware 11 10-04-2008 03:36 PM
Linux Pen Drive 2008 - booting on USB extension PCI Card epanda Linux - Hardware 0 08-30-2008 05:58 AM
USB flash drive (Pen drive) mounts read only prabhatsoni Linux - Hardware 24 07-02-2007 01:28 PM
Wanting a decent distro booting off a 1gb pen drive. Boggy B Linux - Newbie 2 02-18-2005 06:53 AM
USB Pen Drive booting? Aman9090 DamnSmallLinux 2 02-13-2004 08:30 AM


All times are GMT -5. The time now is 07:48 PM.

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