[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re (2): Installing lilo in Squeeze after booting from the Lenny installer CD.



On Thu, 4 Feb 2010 13:14:26 -0500 (EST), peasthope@shaw.ca wrote:
> Stephen,
>
>> I'd try the Squeeze/Sid installer or the "daily build" installer ...
>
> Worked nicely.  Wodim was able to burn the CD on 
> the machine itself, in a drive connected with a 
> USB-ATA adapter.
>
>> ... mount the
>> normal root file system somewhere, then do a chroot to that place in the
>> file system.
>
> Automated well in Rescue mode.  "chroot" isn't 
> stated but I don't know of any likely alternative.

I think you might have been somewhat confused by my suggestions.
I actually gave two completely different alternative recovery scenarios.

Alternative number 1:

Find a Debian installer CD which uses the exact same kernel version that
you are using, then at the boot prompt of the installer CD type

   rescue root=/dev/hda1

(or whatever is the device name of your normal root partition).  I haven't
tried something like this in a long time, but it used to work years ago.
The key is that your rescue CD needs to be running the same kernel
as is on the hard drive to use this method.  Otherwise, it won't be able to load
its modules from /lib/modules on your hard drive.

Alternative number 2:

If you can't find an installer CD which uses the same kernel version that
you are using, then boot the installer, escape to a shell at the appropriate
time, mount your root file system somewhere, then issue a chroot command
to run a nested shell with your normal root file system treated as "/".
There are a number of variations on this method, and someone out there may
wish to elaborate.  I can't test it right now because I'm currently away
from any i386-based Linux machines that I can test with.

These are not two successive steps in a two-step procedure, they are
two completely different alternatives.  But apparently you managed
to get it working somehow.  That is the important thing.

>> ... lilo.conf ... lilo ...
>
> All like clockwork.  One remark and one question.
>
> lilo.conf defaulted boot=/dev/hda1 whereas I 
> expected boot=/dev/hda.  In any case, it works.

With boot=/dev/hda1, lilo will install itself in the boot sector
of the first partition on drive /dev/hda.  To boot lilo installed
this way, you must have a functioning boot loader of some kind
installed in the master boot record which will "chainload" lilo.
The default bootloader from DOS/Windows will work in this case,
provided that /dev/hda1 is marked as the active partition.
This is a safer default.  It prevents you from wiping out your
master boot record.  But most people who install lilo want it installed
in the master boot record.  I assume that you changed
it to say

   boot=/dev/hda

> Many Web pages explain how to boot "single user" 
> with "linux single" at the boot prompt.  OK but 
> I get a two line menu on the coffee picture; 
> managed to interrupt automatic booting but 
> couldn't get a prompt.  What I really want is a 
> single user case in menu.  No mention in 
> lilo.conf.man.  Is it possible?

Read the man page for lilo.conf carefully.  In order to get
a boot prompt you must have the options set right.  The
way mine was set up by default, it boots the default menu
option within two seconds.  To interrupt the process,
press the Shift key (by itself) as soon as you see the
word LILO appear on the screen.  This will give you a
boot prompt.  I.e.

   boot:

At this point you type in the name of the system you want
to boot.  (The default is usually called Linux.)  If you
want to pass options to it, you can do that by typing,
for example,

   Linux single

If you can't remember the name of the system you want to
boot, press the Tab key when the boot prompt is displayed
and it will type out the valid names (kind of like
completion in the shell).  You will then get
another boot prompt and you can type in one of the names listed.
Typically, the backout system is called Linuxold, I think,
and will boot the previous kernel version, if there is
one.  All of this description assumes that you have lilo
set up to use a pure text mode interface and that it is
installed in the master boot record.  I'm worried that it
might not be, since you tell me that a coffee picture is
being displayed.

Now, is it possible to create a third menu item, called
Single, for example, that boots the current kernel in single-user
mode?  Yes, it is possible.  That's not what the designers
intended, but it is possible.  Clone the entry for Linux,
change the name to Single, and put "single" in the append option
for that entry.  Read the man page for details.  I can
send you my lilo.conf file for comparison purposes, but
I don't have access to it right now.


Reply to: