LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Installing LILO on a USB external hdd (https://www.linuxquestions.org/questions/linux-software-2/installing-lilo-on-a-usb-external-hdd-738209/)

himrockffan 07-07-2009 12:35 AM

Installing LILO on a USB external hdd
 
I have looked everywhere ... well ... seemingly everywhere and I have not seen a clear cut or concise way to do this. I have copied my Linux system (Debian Lenny) from my internal hdd(hda) to a 160 GB external hdd(sda) hooked up through USB. I want to be able to boot from this external hdd. The system BIOS will allow ... supposedly ... booting from a USB device. I am using LILO with the internal and would rather continue using it. I don't know if it is installed correctly on the external. I seem to doubt it.

Can anybody tell me where to look for more info? Or perhaps enlighten me on how to install LILO into the MBR of an external USB hdd.

Any other tips would be great as to how to boot my Linux system off of the external

jschiwal 07-07-2009 01:20 AM

Did you edit the lilo.conf file and run lilo to update the boot loader?

How far does the booting process get?

himrockffan 07-07-2009 12:04 PM

Thanks for your response jschiwal. Sorry its been so long since my reply. It was late, had to get to bed and now this is first chance I got. I hope I didn't let this thread dry up.

Here is lilo.conf on hda (sda has exactly the same thing, in fact, everything is the same on sda, because its a copy of hda):
======================================
large-memory
boot=/dev/hda
root=/dev/hda1
map=/boot/map
delay=20
default=Linux
image=/vmlinuz
label=Linux
read-only
initrd=/initrd.img
image=/vmlinuz.old
label=LinuxOLD
read-only
optional
initrd=/initrd.img.old
=======================================
This configuration is out of the box so to speak. How I found it after installation. I have not modified it.

Here is the mtab file while the USB drive is plugged in and running:
===================================================================
/dev/hda1 / ext3 rw,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
/dev/hda9 /home ext3 rw 0 0
/dev/hda8 /tmp ext3 rw 0 0
/dev/hda5 /usr ext3 rw 0 0
/dev/hda6 /var ext3 rw 0 0
/dev/hdb /media/cdrom0 iso9660 ro,noexec,nosuid,nodev,user=himrockffan 0 0
/dev/sda1 /media/XPbackupSystem fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
/dev/sda5 /media/Usr ext3 rw,nosuid,nodev,uhelper=hal 0 0
/dev/sda6 /media/Var ext3 rw,nosuid,nodev,uhelper=hal 0 0
/dev/sda3 /media/disk fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
/dev/sda2 /media/disk-1 ext3 rw,nosuid,nodev,uhelper=hal 0 0
/dev/sda9 /media/Home ext3 rw,nosuid,nodev,uhelper=hal 0 0
/dev/sda8 /media/Tmp ext3 rw,nosuid,nodev,uhelper=hal 0 0
=====================================================================
The root partition is sda2.

In order to boot from sda I suppose I have to run lilo after booting up hda. From what I'm getting I have to config lilo to load onto sda. I'm up in the air as to what lilo.conf needs to do that.

Can anyone help with this?

himrockffan 07-07-2009 02:52 PM

So lilo.conf has to be modified in such a way and executed to install its bootloader in sda's MBR even though this is being done with the currently running operating system off the hda drive. I still don't fully grasp what modifications you make to lilo.conf to get this done. But once lilo's bootloader is installed in sda's MBR and upon trying to boot from sda, there might also be an issue with timing between the USB device's initialization (BIOS activity) and the kernel, on sda, being able to read from it. Apparently this is what the initrd.image is all about. Am I making any sense?

Anyone with experience on this can certainly shed a lot of light on me. Help would be appreciated.

jschiwal 07-09-2009 08:05 PM

Quote:

Here is lilo.conf on hda (sda has exactly the same thing, in fact, everything is the same on sda, because its a copy of hda):
======================================
large-memory
boot=/dev/hda
root=/dev/hda1
map=/boot/map
delay=20
default=Linux
image=/vmlinuz
label=Linux
read-only
initrd=/initrd.img
image=/vmlinuz.old
label=LinuxOLD
read-only
optional
initrd=/initrd.img.old
=======================================
First make a backup copy of your current /etc/lilo.conf file
sudo cp /etc/lilo.conf /etc/lilo.conf.bu

Next, edit /etc/lilo.conf, changing all of the hda's to sda's. The line "boot=/dev/sdb" will cause the MBR to be written to the usb drive instead of your internal hard drive. Now run "sudo /sbin/lilo" to install the boot loader to the usb drive's mbr.
Lastly, let's save a copy of the current lilo.conf file and restore the original
sudo mv /etc/lilo.conf /etc/lilo.conf.usb
sudo mv /etc/lilo.conf.bu /etc/lilo.conf

note: If you look at the manpage for lilo, you could first copy the original to lilo.conf.usb (for example) and use this file when running lilo. You might consider putting a blank line before the "image=" lines. This will make the stanzas stand out better when reading the file.


All times are GMT -5. The time now is 10:06 PM.