I finally found a solution which turns out to be close in spirit to Matt's.
("mount root=/dev/hdax" did not work for me but maybe I did something wrong.)

In what follows, "hdb1" stands for the root filesystem partition, "hda" for
the mbr partition (with windows on it). Adjust your situation accordingly. I
am writing this for the archives in such a way that it may benefit total
newbies who encounter a similar problem, including the vi commands (which I
never used before this point).

1. Boot with the boot disk: type "rescue";

2. Insert rescue disk (created in DOS with rawrite from the CD) when
prompted;

3. At #bash, type "mount /dev/hdb1 /mnt" (your root filesystem may differ,
adjust accordingly); do a "ls" to get familiar with the directory structure
of rescue mode. Check out, e.g, /bin. "more" is not available but "cat" is.
To get your full set of commands, specify the full path through /mnt/...;

4. The lilo command is "/mnt/sbin/lilo"; the vi command is "/mnt/bin/vi".
Note that in rescue mode, the root directory is a level higher than your
normal root directory structure, so /mnt/sbin/lilo /mnt/etc/lilo.conf does
not work;

5. /mnt/etc/lilo.conf must be edited because it is based on the normal, as
opposed to the rescue mode, directory structure. To make sure I did not
change the original, I copied it from ~/mnt/etc/lilo.conf to ~/etc/lilo.conf;

6. "/mnt/bin/vi /etc/lilo.conf". You are in command mode. Press "i" for edit
mode;

7. All lines of lilo.conf _except_  those that have /dev/hda(n) (where n is a
number) must be changed from "/foo/..." to "/mnt/foo/..."; press <escape> to
reenter command mode.

8. Save as follows (changing the name): ":wi lilo1.conf".
Now "cp /etc/lilo1.conf  /mnt/etc/lilo1.conf".

9. "mkdir /boot", then "cp /mnt/boot/chain.b /boot/chain.b" (otherwise
something will go wrong);

10. Finally "/mnt/sbin/lilo -C  /mnt/etc/lilo1.conf". Then you should see
something like this (depending on your original lilo.conf):

Added win *
Added linux

11. Unmount /dev/hdb1 then reboot (I forgot to unmount so Linux took a very
long time boot up while it checked the filesystems).

That's it. The gurus out will surely be able to suggest more efficient ways
of doing this but at least it works (and forces you to learn some vi, which I
will no longer ignore from now on:-( )

Thanks to everyone for their help

Matt Stegman wrote:

> You'll need to point lilo to the right config file: try
>
> bash# /mnt/sbin/lilo -C /mnt/etc/lilo.conf
>
> This tells lilo to use the config file /mnt/etc/lilo.conf.

I did try this. But I still needed to modify lilo.conf itself

> You may also want to symbolically link /mnt/boot as /boot, because your
> old config file points to /boot for all it's info.  If you already have a
> /boot directory on the rescue disk (I don't know, never used it) then:
>
> bash# mv /boot /old-boot && ln -s /mnt/boot /boot

I did not try this but it may relieve the need of step 9, and maybe the need
to modify lilo.conf altogether.

Again, thanks to all

Idris

Reply via email to