LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2004, 04:13 PM   #1
Freederick
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
Question How to add LILO to existing Linux?


I have RedHat8 installed and coexisting with Wirus 98. After an Fdisk disaster I recovered all the partitions, but GRUB doesn't work anymore. I installed the XOSL bootloader to have a working system, but cannot access Linux, just Windoze.
I can see the correct Linux filesystem from a TestDisk program, so the data is still there -- I just can't boot to Linux. I need some of that data with the original configuration, (license manager links, etc.) so reinstalling RedHat is out of the question.
The XOSL manual says it can boot Linux, as long as there is LILO installed on the linux partition.

The question: How do I add LILO to an existing install without reinstalling the whole kit?

Note that there wasn't any LILO in the first place; I chose GRUB, but it is now dead. I have access to another linux system, and can create diskette images and the like, as long as the procedure is not to complex.

Freederick
 
Old 03-28-2004, 04:33 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
First, edit/create /etc/lilo.conf
Second, run /sbin/lilo

LILO fails: Error messages and their interpretation
LILO mini HOWTO
Multiboot with LILO HOWTO
LILO, Linux Crash Rescue HOW-TO
Installing a bootloader
 
Old 03-28-2004, 04:49 PM   #3
Freederick
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
OK, let's assume I can write a correct lilo.conf (based on samples from a working system and some reading). But step 2 is still going to be a problem -- how the heck can I run /sbin/lilo on a system that won't boot to linux? I sure can't run the thing under Windbag :-)

I'm thinking more along the lines of
1. Getting the stuff ready somewhere else and copying it onto the linux partition (assuming I can get into the filesystem somehow, maybe from Knoppix) or
2. Booting the linux from a diskette image -- the problem is, how do I point the boot loader from the diskette to the right partition? I would be creating the diskette on another system, with different configuration.

Freederick
 
Old 03-28-2004, 05:02 PM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Can you boot rescue mode?
Red Hat 8.0 Rescue Mode

If not, can you boot the KNOPPIX live CD?
KNOPPIX Linux Live CD

Last edited by fancypiper; 03-28-2004 at 05:03 PM.
 
Old 03-28-2004, 05:15 PM   #5
Freederick
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Trying to boot in rescue mode gives me a lot of seemingly encouraging lines, the last, however, being:

Kernel panic: No init found.

And then the system freezes :-C

As for Knoppix, I don't have the CD at hand right now, but I assume it would boot. But then what?

Also, would loadlin.exe solve the problem? I just found out it exists.

Freederick
 
Old 03-28-2004, 05:15 PM   #6
hp_tux
Member
 
Registered: Mar 2004
Location: Germany
Distribution: Slackware 14
Posts: 87

Rep: Reputation: 15
Hello,

Quote:
how the heck can I run /sbin/lilo on a system that won't boot to linux?
oh, it's simple: boot with knoppix, mount the Linux partition in rw-mode, "chroot" to the mountpoint of the partition and you can work there as if you have booted this system!

cu

hp_tux
 
Old 03-28-2004, 05:19 PM   #7
Freederick
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Update: the kernel panic problem seems to occur because the dumb thing doesn't know where the linux partition is. I do know -- it's the second (primary) partition on the first hard disk -- but how do I translate this knowledge into a form comprehensible to the LILO?
 
Old 03-28-2004, 05:25 PM   #8
Freederick
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks! This Knoppix trick should work. I didn't know I could boot from Knoppix and then pretend I booted from the original RedHat. I'll have to try this tomorrow, though, as I don't have the Knoppix CD with me.

My plan now (thanks to the help I got)
1. Boot with Knoppix as you said
2. edit lilo.conf
3 run /sbin/lilo

and then it should work, right?

Freederick

P.S. what do I specify in lilo.conf to make sure LILO installs on the linux partition, and not in the MBR or the first partition?
 
Old 03-28-2004, 05:37 PM   #9
hp_tux
Member
 
Registered: Mar 2004
Location: Germany
Distribution: Slackware 14
Posts: 87

Rep: Reputation: 15
Hello,

Quote:
1. Boot with Knoppix as you said
2. edit lilo.conf
3 run /sbin/lilo

and then it should work, right?
but don't forget the "chroot" step!

cu

hp_tux
 
Old 03-28-2004, 06:05 PM   #10
Freederick
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Original Poster
Rep: Reputation: 0
The dang thing worked, and without Knoppix!

I typed linux root=/dev/hda2 rw at the diskette LILO prompt. The thing has kept trying to boot from hda3, which is the swap partition. It took me a while to figure out the proper syntax, though.

What the problem was:
As I said, I recovered the partitions after an fdisk misuse (to put it mildly -- actually what I did was remove the partitions on the wrong drive :-O).
It appears the partitions were in different order previously, so what is now hda2 used to be hda3 -- and the boot diskette couldn't figure it out.

Now on to the next step: configuring and running LILO.

Freederick

P.S. But first I'll edit lilo.conf on the diskette, so that it points the right way. Shouldn't the darn thing be able to recognize which partition is the right one? There is only one disk, and only one ext3 partition on it. Oh well....

P.P.S. I still don't know how to make sure LILO installs on the linux partition only when it runs. I'll figure it out eventually.

Thanx, fancypiper and hp_tux!
 
  


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
How to add a hard drive existing Linux system a1ntsk33r3d Linux - Hardware 5 06-28-2005 03:20 PM
How to add an existing linux on a newly added disk to grub ? glenn69 Linux - Newbie 1 10-07-2004 10:16 PM
Add to existing path environment explorer Fedora 5 04-16-2004 05:27 PM
How to add new partition before Linux partition in an existing Linux box? ashutosh Linux - Software 3 04-23-2002 04:26 AM
Add a new hard drive to existing RH 7.2 guanyu Linux - Software 1 02-27-2002 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:36 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