LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LILO / lilo.conf - can't change the config (http://www.linuxquestions.org/questions/linux-newbie-8/lilo-lilo-conf-cant-change-the-config-63558/)

clearh20 06-04-2003 01:26 AM

LILO / lilo.conf - can't change the config
 
Ok, this one is driving me nuts. Most of the time I mess with it until I get it right, but this time I'm flat out of ideas.

I did all the updates and such for RH v9, and now I got the new kernel in the /boot directory. At the end of the installtion it said "LILO test configuration failed" (or something very similar to that). No big deal, I jump into the shell and see that lilo.conf has been updated and all looks well.

Now, for the past few days, I've been trying to get the options on the LILO menu to just represent RH and Win2k. I don't need to bother with any BOOT kernels..and don't even want them on the list.

Enter lilo.conf. I edited out the stuff I didn't want, and left in the two OS's I wanted listed. The computer still brings up LILO fine - but none of the changes I made show up.

So I do some reading, and find out I need to run /sbin/lilo to write the changes. I try, and I get a "cannot execute binary" error.

RH is on /dev/hda7, and Win2k is /dev/hda1. I have System Commander booting up right after POST, and from there I normally pick RH and then LILO comes up. (Ok, so I don't need both - but I got them!) Technically, I don't want LILO on my MBR, but I *do* want it on the first sector (?) of the RH partition.

How do I get the changes in lilo.conf to take w/o writing over my MBR that is using System Commander? Everything was fine with how LILO was configured under RH v8, but now that I'm using v9, I'm having headaches.

Help, or possibly a beer, would be nice....:confused:

Believe it or not, I'm honestly trying to learn Linux....and I'm getting better - I'm just not good enough yet to figure out simple problems.

If this makes no sense, I apologize. I'm tired and ticked. I'll try to explain more after getting some rest.


Thanks again.

acid_kewpie 06-04-2003 06:35 AM

if your boot= line says hda then it will hit the mbr, if it says hda1 then the first partition and so forth. but you must rerun lilo for the changes to taje effect. what are you actually doing to get that "unable to execute" message? the program might be corrupted.

clearh20 06-04-2003 10:13 AM

acid_kewpie,

Here's my current lilo.conf (originally auto generated by the RHv9 install, then an attempt at updating it after last nights RHN kernel update (to 2.4.20-18.9)

prompt
timeout=50
default=2.4.20-18.9
boot=/dev/hda7
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.20-18.9
label=RedHat Linux v9.0
append="hdc=ide-scsi root=LABEL=/"
read-only
initrd=/boot/initrd-2.4.20-13.9.img

other=/dev/hda1
optional
label=Windows 2000
---------------------------------------------------------------------

Quote:

what are you actually doing to get that "unable to execute" message? the program might be corrupted.
Now, to get the "cannot execute binary" message, I'm going into /sbin and trying to run the "lilo" command. I read that it's supposed to update itself from data containted in lilo.conf. So, that's what I try. I try to type "lilo", I get "command not found". I cd to /usr/sbin/ and type "lilo", I get "command not found". I go back into /sbin and now I try "sh lilo" (with a few arguments), and I get "cannot execute binary". I do the same in /usr/sbin.

I'm almost positive the file I need to get working is in /sbin not /usr/sbin - But I figured I'd try anyway.

The information I'm using is coming from:
http://www.die.net/doc/linux/man/man8/lilo.8.html
http://gd.tuwien.ac.at/opsys/linux/L...nux-fdisk.html

(On the second link, it's just the part about editing lilo.conf, obviously :) )

If it's corrupted, how do I go about fixing it?

THANKS!

whansard 06-04-2003 10:24 AM

/sbin/lilo

clearh20 06-04-2003 10:41 AM

That's what I've been trying to run, and it's not working. :study:

acid_kewpie 06-04-2003 10:45 AM

no, what you say you've been doing is "cd /sbin; lilo" which is not the same. if /sbin is not on your path then it will say command not found. as for "can not execute" you're trying to run a binary program through sh, which is expecting a script file. your equivalent there would be "sh -c lilo" or something, but this is not what you should be doing. run "/sbin/lilo" completely and it should work fine.

0x4B 06-04-2003 12:43 PM

you also will need to be root (and /sbin should be in root's path). if you're in the directory of an executable, prepend it with ./ to specify the local path (e.g. cd /sbin; ./lilo)

clearh20 06-04-2003 06:24 PM

Hrm..well you're right! running /sbin/lilo works. I'm still used to going to a specific directory to execute a program... I'll remember the ./ trick.

Running /sbin/lilo seemed to work -
Though, I get an 'error on line 12'. But from what I see, it looks fine. The response also says "Added RedHat Linux".

Problem is, on reboot...all of the options I got rid of are *still* there, and the *new* kernel isn't showing up in the list.

I've got to be doing something stupid. My boot loader cmoes up as a screen w/ a RH picture, and a list of available options on the right. You scroll through them w/ a keyboard. That's LILO, right? I always thought GRUB was just a black screen with options (nothing fancy) - but I guess I could be wrong.

Either way, I checked /boot/grub/grub.conf and /boot/grub/menu.lst and they're all ok.

When I do a uname -a I get told I'm still running the 2.4.20-13.9 kernel...when I can plainly see the 2.4.20-18.9 is in /boot as well. The new kernel is also referenced in lilo.conf (see post above), but of course, I don't have that option.

Any suggestions?

:newbie: :study:

0x4B 06-05-2003 01:00 PM

when lilo states "added" blah, it doesn't mean that its a new addition, just that it placed the option in the boot record. each time it runs, it should "add" each boot option. chances are that it failed (at line 12) to add the new one. is line 12 the read-only statement?

I've actually never used GRUB, but lilo used to be just a couple text options but there are versions that look more like a menu system with multiple columns. if you do a google search for grub boot loader with the images option, you can get some idea of what grub looks like.

Wolfie 06-05-2003 04:33 PM

try taking the space out of your line"label=Windows 2000" I have found redhat does not like spaces

michaelk 06-05-2003 05:14 PM

I agree it could be the spaces also your default=<label> needs to match one of the actual labels and 2.4.20 doesn't match.

Also if there are any error messages I don't lilo will actually write a boot record.

clearh20 06-05-2003 07:15 PM

You guys rock!
 
You guys ROCK!

Ok, so I took out the spaces, and changed the label of the kernel I wanted to use so it matched the default= statement. The spaces caused a Syntax error when I ran /sbin/lilo, but after I took them out - all was well.

It was failing on line #12 before because of the labeling issue. As soon as I changed it to "2.4.20-18.9", it worked fine! It makes much more sense to me now, now that I've worked through this problem.

Oh yah, I also had to match up the .img file to the CORRECT kernel version - that was my goof (tired + vi = stupid mistake).

My one, final question (for now) is: can i just delete all of the old kernel versions? I can see keeping one & it's "BOOT" version, but the rest just seem to be excess. Yes? No.

THANK YOU FOR YOUR HELP!


=========================================

In case anyone is interested for future reference, this is what the *NEW* (WORKING) lilo.conf looks like:

prompt
timeout=50
default=2.4.20-18.9
boot=/dev/hda7
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.20-18.9
label=2.4.20-18.9
append="hdc=ide-scsi root=LABEL=/"
read-only
initrd=/boot/initrd-2.4.20-18.9.img

other=/dev/hda1
optional
label=Windows2000


===========================

whansard 06-05-2003 07:58 PM

delete away. they're in /boot/
the modules are in /lib/modules under the kernel version.
be careful dangit.

clearh20 06-05-2003 09:44 PM

done!

/lib/modules

This is a complete guess on my part, but is that the area I'd be working in if I ever go the guts to recompile my own kernel?

Just curious.

Thanks.

whansard 06-05-2003 10:20 PM

no, thats just where the modules go. i think they
should go in boot, but they don't.


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