LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-07-2004, 01:59 AM   #1
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
LILO using wrong kernel on dual boot system


Hi,

I am currently developing a new distro from code. On my development machine, I have my base system on hda1 and my development system on hdb1.

Now, when I try to boot my development system from LILO, it uses the kernel from /boot on hda1, not the kernel from /boot on hdb1. What is the problem?

This is my lilo.conf file:

Code:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hda
#compact        # faster, but won't work on all systems.
prompt
timeout = 50
# VESA framebuffer console @ 800x600x64k
vga = 788
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# ramdisk = 0     # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/hda1
  label = Linux
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
  append = "console=tty0 console=ttyS0"

# Linux bootable partition config ends

# Linux bootable partition config begins
image = /boot/vmlinuz
  root =/dev/hdb1 
  label = Mini-Slack
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
  #append = "init=/sbin/init"
# Linux bootable partition config ends
 
Old 03-07-2004, 02:07 AM   #2
urzumph
Member
 
Registered: Jan 2004
Location: Australia
Distribution: Debian
Posts: 168

Rep: Reputation: 30
assuming you are using the lilo on hda1

Your second section should read :

# Linux bootable partition config begins
image = /mnt/hdb1/boot/vmlinuz
root =/dev/hdb1
label = Mini-Slack
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
#append = "init=/sbin/init"
# Linux bootable partition config ends

Assuming of course, the hdb1 is mounted at /mnt/hdb1
 
Old 03-07-2004, 02:16 AM   #3
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
How can I mount hdb1 before LILO starts?
 
Old 03-07-2004, 05:34 AM   #4
urzumph
Member
 
Registered: Jan 2004
Location: Australia
Distribution: Debian
Posts: 168

Rep: Reputation: 30
I am not sure what you are asking, but I will try to answer as best I can :

When your computer boots, AFAIK, nothing is mounted and all LILO does is point the CPU at the kernel so it can start executing (Sorry, I don't really know a lot about this, perhaps you could ask a lilo dev for more info?) So, as long as lilo knows which kernel you are talking about when you write lilo to the MBR, it doesn't matter what is mounted where - lilo can get it. (Notable exception - I believe you need a special BIOS to run kernels off network drives)

If you've ever had to run lilo from knoppix you'll know what I am talking about - to successfully write it to MBR, you have to change all paths from /boot/* to /mnt/hdx/boot/* (of course, after doing this a couple of times, I have found the -r option, which is very helpful when fixing a broken lilo from boot disk)

Now, I can't be sure if any of that made sense (sorta tired), so I'll just re-phrase my last line

Assuming of course, the hdb1 is mounted at /mnt/hdb1 when you run /sbin/lilo

*EDIT* I must be tired, LILO is writen to MBR, NOT the BIOS

Last edited by urzumph; 03-07-2004 at 05:36 AM.
 
Old 03-07-2004, 05:08 PM   #5
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
So you are saying that the location of the kernel is only important when i actually run /sbin/lilo?

So I need to point to the location of the second kernel while the system is running, and LILO will sort it all out at boot?
 
Old 03-07-2004, 05:24 PM   #6
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Ok, I just rewrote my lilo.conf to point to the kernel on the second HDD:

image=/mnt/target/boot/vmlinuz

Now, when I actually run /sbin/lilo, it doesn't complain about the file not being there (assuming HDB1 is mounted to /mnt/target), but when I actually boot the system, LILO gives the error 0x01 (illegal command).

I don't think you can tell LILO to boot a kernel that is on a mounted drive, since that mount isn't going to exist when the system boots, and LILO isn't going to be able to locate the kernel.

Does anybody else have any experience with this kind of thing?
 
Old 03-08-2004, 12:26 AM   #7
urzumph
Member
 
Registered: Jan 2004
Location: Australia
Distribution: Debian
Posts: 168

Rep: Reputation: 30
Quote:
I don't think you can tell LILO to boot a kernel that is on a mounted drive, since that mount isn't going to exist when the system boots, and LILO isn't going to be able to locate the kernel.
Well, either I'm superman and can do the impossible, or you can, because I have done it before.

And to follow that logic through, you shouldn't be able to boot ANY kernel, because your root partition is simply mounted at / (instead of /mnt/*)

try lilo -v and see if you get any error messages.
 
Old 03-08-2004, 12:50 AM   #8
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
You know what,

mount ur /hdb1 partition and go to the /boot directory there. From there, copy the vmlinuz.xxxx and the initrd.XXXX.img file into the /boot directory of hda1.

And in your lilo.conf, you will need to write the complete thing instead of just vmlinuz.

That will solve your problem.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dual boot gone wrong slap Linux - Newbie 34 11-17-2005 10:58 AM
Dual-Boot gone wrong? RallyMonkey Fedora - Installation 7 05-17-2004 10:41 PM
Lilo lost, Install disk failing to restore Lilo on dual boot? Dobie Linux - Newbie 2 05-05-2004 05:00 PM
What to do with /boot/System.map on dual Kernel boot? cathodion Linux - General 2 05-17-2002 11:19 AM
Trying to have a dual boot system with lilo Hawk Linux - Newbie 1 02-08-2002 09:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:01 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration