Booting a usb pen drive from lilo
I know it SHOULD be easy.
Here's my config: Code:
/dev/hda1 Windows 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 I've tried as a Windows/DOS partition (Same results) Ideas? |
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 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 |
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.
|
Quote:
And, then, add a lilo section to point to these? With "append = rootdelay 10" and "root = /dev/sda1"? |
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.
|
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... |
Are you using the rootdelay option in the kernel commandline? Please post your new lilo.conf file
|
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 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 |
use bs=446 to copy bootloader bytes, else you copy also the partition table
http://en.wikipedia.org/wiki/Master_boot_record |
Quote:
I'll post my new lilo.conf as soon as I get to my linux box. Thanks |
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. |
All times are GMT -5. The time now is 10:42 PM. |