Re: [ILUG] whoops

From: Kenn Humborg (kenn at domain avalon.wombat.ie)
Date: Thu 07 Oct 1999 - 11:23:07 IST


On Thu, Oct 07, 1999 at 09:45:22AM +0100, John McCormac wrote:
> Ken Guest wrote:
> >
> > ok,
> > I did something unbelievably daft last night.
> > Compiled a SuSE 5.2 kernel for ip forwarding,
> > made a backup copy of the existing one and put
> > the new kernel in place.
> > And then rebooted.
> >
> > 2 seconds later I realised 'b*&%*&% I forgot to
> > run lilo!'
>
> Use a boot floppy to boot the system. (I think that there is a good
> emergency root disk on Slackware 4.0 and probably most of the distros).
> After booting, and switching to the emergency floppy, mount the root,
> move the kernels. Then reboot again. This time, mount your / partition
> from the boot: parameter. Then you may be able to run lilo again.

Moving the kernels back will not guarantee that the old kernel ends up
in the same sectors on disk. In fact, here is a tip:

TIP OF THE DAY: When copying a kernel over another kernel, always backup
                 the old kernel by moving it, not copying it. For example:

                    # mv /boot/vmlinuz /boot/vmlinuz.backup
                    # cp /usr/src/.../zImage /boot/vmlinuz

                 Do not do:

                    # cp /boot/vmlinuz /boot/vmlinuz.backup
                    # cp /usr/src/.../zImage /boot/vmlinuz

                 Doing it the first way ensures that the old kernel still
                 resides in the same sectors that it always did so that
                 LILO can still find it if you forget to re-run lilo (or
                 if you get a power failure before you get a chance to
                 run it).

Easier way to solve Ken's problam...

1. boot from emergency boot floppy.
2. Mount your old root partition manually:

   # mount -t ext2 /dev/hdXX /mnt

3. Pop in a blank floppy.
4. Locate your original kernel and copy it to the floppy

   # cp /mnt/boot/vmlinuz /dev/fd0

5. Sync and reboot.
6. Kernel will load from floppy and system will start as normal.
7. Run lilo!

It's a good idea to keep a plain kernel-boot floppy around.
See the rdev(8) man page for info on configuring the root device
and other stuff on a raw kernel.

Later,
Kenn



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:41 GMT