LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   What to do when you forgot to 'lilo'...(my little guide) (http://www.linuxquestions.org/questions/slackware-14/what-to-do-when-you-forgot-to-lilo-my-little-guide-176317/)

RohanRNS 04-30-2004 08:32 AM

What to do when you forgot to 'lilo'...(my little guide)
 
Recently I went crazy because I upgraded the kernel, didn't make a backup kernel, and forgot to lilo....then I went and rebooted my box....

So here is my little guide to help if you ever end up in this situation :D

First, go make sure that linux will not boot...reboot your machine, at lilo boot screen, press enter, and the computer should more or less just hang up. At least this is what happened to me.

Next, find you slackware install cds, yea they are actually useful AFTER the install :p

Load up the slackware cd, when it asks what kinda kernel to boot, just do that standard (bare.i) by hitting enter.

When your all ready to go, login as root, and mount your hard drive.

Its usually something like:
Code:

mount /dev/hda3 /mnt
hda3 would be your root partition....change it to meet your setup.

next, you gotta 'lilo'...so:

Code:

/mnt/sbin/lilo -C /mnt/etc/lilo.conf
of course make sure that lilo.conf is edited up to whatever you like...

IF by chance you get something like: This will overwrite/destroy - something something
Then DO:

Code:

/mnt/sbin/lilo -F -C /mnt/etc/lilo.conf
after this it should say the beloved:
Quote:

Added Linux *
or something along the lines of that...

Now reboot, and you should be all ready to go :)

Duffy 04-30-2004 12:35 PM

I also have used Knoppix to chroot into my Slackware 9.1, recomplied my kernel and edited lilo and fixed my messed up Slackware kernel

:)

Muzzy 04-30-2004 01:30 PM

I always keep some known working kernels and keep a choice in my boot menu, then if I mess something up with a new kernel (like making my root filesystem a module - d'oh!), one of the older kernels will still boot. It doesn't take up that much hard disk space and there is no performance penalty.

little_ball 04-30-2004 02:54 PM

it happend to me once, what i did was use the first install CD push enter, login as root and then, mount my root partition to mnt, and then:

chroot /mnt /sbin/lilo

and get the message:
Added Linux*

another way is to in the first boot prompt do mount root=/dev/hdax and enter, login as root, and then just type /sbin/lilo.

it's not hard but could get anyone go crazy if don't know what to do.

Shade 04-30-2004 09:32 PM

I *rarely* remove a working kernel.

I just add the kernels to boot and lilo.conf like so

Code:

/boot/vmlinuz-2.6.5
/boot/vmlinuz-2.6.3
/boot/vmlinuz-2.4.22-ide

And skip the whole forgetfulness thing by not using a symlink with vmlinuz or replacing it.

--Shade

Schrambo 05-01-2004 06:16 AM

would this method work for re-installing lilo.

Cuase my win2k install is being an arsehat and I need to format it. Doing so will override the LILO boot manager, thus loosing access to slackware.

so after I re-installed windows, would I be able to just boot witht he slackware CD and follow the same steps to get lilo installed again?

or would there be a better preferance of steps for my situation? (I don't have an emergency floppy boot disk cause I didn't have a floppy drive installed at the time)

sorry for the hijack. oh and thanks for the tip anyways Shade. it'll come in handy one day

Duffy 05-01-2004 12:36 PM

You guys need to learn about bootpart

I installed Slackware 9.1, Lilo to my / partition, just added Slackware 9.1 to Lilo and finished the installation of Slackware 9.1 and restarted back into windows.

Ran bootpart as per instructions above ( skiped down to Create dual-booting in NT/2000 ), and it worked

:)

little_ball 05-01-2004 02:28 PM

Yes Schrambo when a new windows installation delete lilo of any linux from MBR you don't loose your linux, you just have to reinstall lilo whit the installation CD in the case of slack, just enter CD1 boot it up, push enter to use the default kernel image, login whit a user name you know root, and then instead of go to cfdisk make partitions bla bla, just run setup and select the part of install lilo. =P

Schrambo 05-01-2004 10:11 PM

thanks little_ball, thought it would be as simple as something like that, like most things in slackware. :D.

Schrambo 05-01-2004 10:11 PM

thanks little_ball, thought it would be as simple as something like that, like most things in slackware. :D.

I might formatt and re-install windows maybe later on today. I'll report on my sucess.

Linux.tar.gz 05-02-2004 12:41 PM

For my part, i never delete the last working kernel...

little_ball 05-03-2004 11:16 AM

Schrambo i'm so so, sorry. i thought that slackware Setup bring how to reinstall lilo which it not. yesterday someone install windows under my box, and i lost slackware lilo of course, i try to reinstall lilo whit the CD1 and setup, didn't find it, in fact i did found lilo setup installation when i prompt the command liloconfig if you loose your lilo, please do the command liloconfig and not setup. sorry for that mistake.

Schrambo 05-03-2004 09:22 PM

no problems little_ball I havent gotten round to formatting windows just yet so no harm done.

So just boot the CD1, go default kernel, slackware login as root, then at the command go liloconfig. too easy :D
thanks again for the help.

Schrambo 05-05-2004 12:38 AM

little_ball. I just tried to give this a little shot on my spare boxen which i use for testing and whatnot. Anyways it doesn't have slackware installed and I just tired booting with the CD and going "liloconfig" but it says command cannot be found". So obvioulsy I have to boot into slackware first in order to do the liloconfig. how do you do this from the CD. do i just go /mount /dev/hda2 then run the liloconfig from there or what?

or should i just make a new boot floppy and use that?

thanks.

elluva 05-05-2004 07:45 AM

Re: What to do when you forgot to 'lilo'...(my little guide)
 
Quote:

Originally posted by RohanRNS
/mnt/sbin/lilo -C /mnt/etc/lilo.conf
Another thing you can do is booting of that cd and when you come at the prompt type
Code:

bare.i root=/dev/hdxx ro
this way you just boot into your existing system with the kernel from CD. Then you just log on as root and type lilo. I think this way is somewhat easier, but just chose what you like best :D.

Greetingz,
elluva


All times are GMT -5. The time now is 05:22 PM.